After upgrading to Smack 4.1.4 we are experiencing the exception
We have 3,451 users in openfire, which has not been an issue previously. The following code is being used to replicate the issue:
final XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();
builder.setServiceName("HOSTNAME");
final XMPPTCPConnectionConfiguration config = builder.build();
final XMPPTCPConnection connection = new XMPPTCPConnection(config);
connection.connect();
System.out.println("connection.isConnected() = " + connection.isConnected());
connection.login("USERNAME", "PASSWORD", null);
System.out.println("connection.isAuthenticated() = " + connection.isAuthenticated());
System.out.println("Initiating roster load");
final Roster roster = Roster.getInstanceFor(connection);
System.out.println("Returned from initiating roster load");
final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
while(true){
final String input = reader.readLine();
if(input!=null){
break;
}
}
connection.disconnect();
Output from the program :
Nov 19, 2015 12:59:32 PM org.jivesoftware.smack.util.DNSUtil resolveXMPPDomain
WARNING: No DNS Resolver active in Smack, will be unable to perform DNS SRV lookups
connection.isConnected() = true
connection.isAuthenticated() = true
Initiating roster load
Returned from initiating roster load
Nov 19, 2015 12:59:34 PM org.jivesoftware.smack.AbstractXMPPConnection callConnectionClosedOnErrorListener
WARNING: Connection closed with error
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@3b19079e rejected from java.util.concurrent.ThreadPoolExecutor@142401c1[Running, pool size = 1, active threads = 1, queued tasks = 97, completed tasks = 265]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoo lExecutor.java:2048)
at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.jav a:110)
at org.jivesoftware.smack.AbstractXMPPConnection.processPacket(AbstractXMPPConnect ion.java:984)
at org.jivesoftware.smack.AbstractXMPPConnection.parseAndProcessStanza(AbstractXMP PConnection.java:969)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$500(XMPPTCPConnection.java: 140)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPC onnection.java:989)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPCon nection.java:944)
at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnecti on.java:959)
at java.lang.Thread.run(Thread.java:744)
Despite the above error if I add a org.jivesoftware.smack.roster.RosterListener to the roster I can see that we receive 3447 entries added. I’m not sure where the missing 4 go from the 3451 users in openfire, but I am cannot say whether that is significant to this issue or not.
I have enabled the smack.debugEnabled system property, but fail to see any other errors that would help me diagnose this issue.
Has anyone else experienced this issue and come across a solution? Is this a not entirely unexpected error that I should be catching/logging/ignoring?
Thanks,
Sam Clunie