XMPPTCPConnection cannot be resolved to a type?

Use Case: Applet that wraps Smack so that some JavaScript code can send a message via Smack. (A webpage is sending notification messages; bi-directional communication is not needed.)

I haven’t found such an applet so I am developing one.

I started with a simple code snippet from the latest Smack Overview documentation. But, I am getting the error message “XMPPTCPConnection cannot be resolved to a type”.

I imagine I am missing something really basic? Sorry if I am, but it’s strange that Eclipse can resolve XMPPConnection with my setup but can’t resolve XMPPTCPConnection. (Perhaps the Overview could be updated with whatever I am missing.)

My set up is as follows:

  • Eclipse IDE for Java Developers, Luna Service Release 1 (4.4.1)
  • My project has a referenced library, specifically: smack-core-4.0.6.jar
  • I have just one src file in my project, “SmackWrapper.java”

Here’s a screenshot:

smack-core does not contain XMPPTCPConnection, smack-tcp does, you may also want to add smack-resolver-javax. And I really recommend using a build system that’s able to resolve maven dependencies. So you just have to declare a dependency on smack-java7 and smack-tcp and be done. Otherwise you may encounter additional compile and runtime errors.

Thank you! Until your response I wasn’t aware of the smack-tcp*.jar file because, for some unknown reason, it wasn’t extracted when I unzipped the http://download.igniterealtime.org/smack/smack_4_0_6.zip file. Also, it isn’t mentioned in the list of jar files on the Getting Started page, and based on that page I incorrectly thought that the core file was all I would need for the basic code snippet.

Thanks for the feedback. I’ll update the getting started document.