powered by Jive Software

Problem with creating MUC in applet


I write something like this:

ServiceDiscoveryManager serviceDiscoveryManager = new ServiceDiscoveryManager(czat.con);


DiscoverItems result = serviceDiscoveryManager.discoverItems(“czat.server.pl”);

for (Iterator items=result.getItems(); items.hasNext(); ) {

DiscoverItems.Item item = ((DiscoverItems.Item)items.next());

pole_rozmowy.append(“Room JID:” + item.getEntityID());



catch(XMPPException e){pole_rozmowy.append("E: "+e);}

    MultiUserChat muc = new MultiUserChat(czat.con, "test@czat.server.pl");


catch(XMPPException e){pole_rozmowy.append("E: "+e);}

and it works like an aplication, but like an applet it throws ClassCastException. What is wrong?

Hey Robert,

Could you paste the stack trace of the exception?


– Gato




at org.jivesoftware.smackx.ServiceDiscoveryManager.discoverItems(ServiceDiscoveryM anager.java:425)

at org.jivesoftware.smackx.ServiceDiscoveryManager.discoverItems(ServiceDiscoveryM anager.java:389)

at GroupCzatWindow.wejdzDoPokoju(GroupCzatWindow.java:82)

at GroupCzatWindow.(GroupCzatWindow.java:76)

at Main$SluchaczWejdzDoPokoju.actionPerformed(Main.java:193)

at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)

at javax.swing.DefaultButtonModel.setPressed(Unknown Source)

at javax.swing.AbstractButton.doClick(Unknown Source)

at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)

at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(Unknown Source)

at java.awt.Component.processMouseEvent(Unknown Source)

at java.awt.Component.processEvent(Unknown Source)

at java.awt.Container.processEvent(Unknown Source)

at java.awt.Component.dispatchEventImpl(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)

at java.awt.Container.dispatchEventImpl(Unknown Source)

at java.awt.Window.dispatchEventImpl(Unknown Source)

at java.awt.Component.dispatchEvent(Unknown Source)

at java.awt.EventQueue.dispatchEvent(Unknown Source)

at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

at java.awt.EventDispatchThread.run(Unknown Source)


I don’'t have access to the source code right now but it seems that the folder META-INF which contains the file smack.providers is not present in you classpath. Make sure to add that folder to your classpath and let me know if you are still having that problem.


– Gato


I know everything you wrote. My problem is how to add this folder to classpath. My app consists of three files: smack.jar, smackx.jar and myapp.jar.

I`m trying to insert the smack.providers file to meny locations: to root of myapp.jar file, to meta-inf folder in myapp.jar file and to meta-inf folder in publichtml folder on server. I have no more ideas.


If you are using the original smack.jar and smackx.jar, you shouldn’'t have to add the smack.providers file to your jar file.

Could you check if smackx.jar contains the smack.providers file under META-INF (in upper case the folder)? I guess that this may be a problem of case sensitivity. Could you try renaming meta-inf to uppercase if it’'s in lower case in the jar file?

Let me know if that helps.


– Gato


I use orginal smackx.jar file.

The META-INF folder is in uppercase, and contains the smack.providers file.


Just to do a follow up so that anyone could know what happened. The problem was generated due to a security exception thrown when trying to get a system classloader.

Since we didn’‘t really need that classloader to find Smack’'s resources we opted for removing that classloader.


– Gato