githubw2015 / asmack

一个小的例子
https://github.com/githubw2015/asmack
Other
0 stars 0 forks source link

ServiceDiscoveryManager have to load before MultiUserChat. #35

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago

** IF NOT **
You will see following error messages:

E/XMPPConnectService( 8951): null
E/XMPPConnectService( 8951): java.lang.NullPointerException
E/XMPPConnectService( 8951):    at 
org.jivesoftware.smackx.muc.MultiUserChat$1.connectionCreated(MultiUserChat.java
:124)
E/XMPPConnectService( 8951):    at 
org.jivesoftware.smack.XMPPConnection.initConnection(XMPPConnection.java:618)
E/XMPPConnectService( 8951):    at 
org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.j
ava:565)
E/XMPPConnectService( 8951):    at 
org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:991)
.....

ConnectionCreationListener does not seem to working when connecting at first.

And, when connecting at 2nd, static code 
"ServiceDiscoveryManager.getInstanceFor(connection)" returns null in 
MultiUserChat.

** EASY PATCH **
in static code:

static { 
      ServiceDiscoveryManager.getIdentityName();  // <- added. this is dummy code.
      Connection.addConnectionCreationListener(new ConnectionCreationListener() {

Original issue reported on code.google.com by maim...@gmail.com on 28 Aug 2010 at 1:54

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Maybe this issue is same as  issue 13 ,
I'm using asmack-2010.05.07.jar

Original comment by maim...@gmail.com on 30 Aug 2010 at 2:08

GoogleCodeExporter commented 8 years ago
You will find a version which contains a fix for this issue at the new home of 
aSmack: https://github.com/flowdalic/asmack

Please make sure to read the provided README or else it may not work!

Original comment by fschm...@gmail.com on 20 Feb 2013 at 4:43