powered by Jive Software

Cant connect to server IllegalStateException and EOFException: no more data

Hi. I’'ve been facing few problems with smack. First one was:

http://www.jivesoftware.org/community/thread.jspa?threadID=18207&tstart=0

I kind of got through it. I have added few System.out.println("…"); in ProviderManager class and started to get this error:

14:47:35,421 INFO java.lang.IllegalStateException: Not connected to server.

14:47:35,421 INFO at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkWrite(SSLSocketImpl.java:1168)

14:47:35,421 INFO at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:43)

14:47:35,421 INFO at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:336)

14:47:35,421 INFO at sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(StreamEncoder.java:404)

14:47:35,421 INFO at sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:408)

14:47:35,421 INFO at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:152)

14:47:35,421 INFO at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)

14:47:35,421 INFO at java.io.BufferedWriter.flush(BufferedWriter.java:236)

14:47:35,421 INFO at org.jivesoftware.smack.PacketWriter.writePackets(PacketWriter.java:249)

14:47:35,421 INFO at org.jivesoftware.smack.PacketWriter.access$000(PacketWriter.java:34)

14:47:35,421 INFO at org.jivesoftware.smack.PacketWriter$1.run(PacketWriter.java:69)

14:47:35,421 INFO java.io.EOFException: no more data available - expected end tag </stream:stream> to close start tag stream:stream from l

ine 1, parser stopped on END_TAG seen …</stream:features>… @1:342

14:47:35,421 INFO at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3014)

14:47:35,421 INFO at org.xmlpull.mxp1.MXParser.more(MXParser.java:3025)

14:47:35,421 INFO at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1144)

14:47:35,421 INFO at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)

14:47:35,421 INFO at org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:352)

14:47:35,421 INFO at org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:43)

14:47:35,421 INFO at org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:63)

Has anyone had seend something like this?

Any ideas how to overcome it?

Thanks in advance.

This is stack trace I get without those System.out.println() in provider class:

15:34:38,218 INFO SASL RESPONSE CLASS:class org.jivesoftware.smack.PacketReader$4

15:34:38,218 INFO SASL RESPONSE CLASS:class org.jivesoftware.smack.PacketReader$4

15:34:38,218 INFO java.lang.ClassCastException: org.jivesoftware.smack.PacketReader$4

15:34:38,218 INFO at org.jivesoftware.smack.SASLAuthentication.bindResourceAndEstablishSession(SASLA uthentication.java:309)

15:34:38,218 INFO at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java: 211)

15:34:38,218 INFO at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:410)

15:34:38,218 INFO at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:374)

15:34:38,218 INFO at org.mobicents.slee.resource.xmpp.XmppResourceAdaptor$XmppRASbbInterfaceImpl.con nectClient(XmppResourceAdaptor.java:

15:34:38,218 INFO at org.mobicents.examples.wakeupbot.WakeUpBotSbb.onStartServiceEvent(WakeUpBotSbb. java:104)

15:34:38,218 INFO at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

15:34:38,218 INFO at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

15:34:38,218 INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)

15:34:38,218 INFO at java.lang.reflect.Method.invoke(Method.java:585)

15:34:38,218 INFO at org.mobicents.slee.runtime.SbbEntity.invokeEventHandler(SbbEntity.java:1643)

15:34:38,218 INFO at org.mobicents.slee.runtime.EventRouterImpl.routeTheEvent(EventRouterImpl.java:1 158)

15:34:38,218 INFO at org.mobicents.slee.runtime.EventRouterImpl.access$100(EventRouterImpl.java:81)

15:34:38,218 INFO at org.mobicents.slee.runtime.EventRouterImpl$EventExecutor.run(EventRouterImpl.ja va:176)

15:34:38,218 INFO at EDU.oswego.cs.dl.util.concurrent.QueuedExecutor$RunLoop.run(QueuedExecutor.java :88)

15:34:38,218 INFO at java.lang.Thread.run(Thread.java:595)

15:34:38,390 INFO Connection to server failed! Error:

15:34:38,390 INFO (405)

15:34:38,390 INFO at org.jivesoftware.smack.NonSASLAuthentication.authenticate(NonSASLAuthentication .java:62)

15:34:38,390 INFO at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java: 224)

15:34:38,390 INFO at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:410)

15:34:38,390 INFO at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:374)

15:34:38,390 INFO at org.mobicents.slee.resource.xmpp.XmppResourceAdaptor$XmppRASbbInterfaceImpl.con nectClient(XmppResourceAdaptor.java:

15:34:38,390 INFO at org.mobicents.examples.wakeupbot.WakeUpBotSbb.onStartServiceEvent(WakeUpBotSbb. java:104)

15:34:38,390 INFO at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

15:34:38,390 INFO at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

15:34:38,390 INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)

15:34:38,390 INFO at java.lang.reflect.Method.invoke(Method.java:585)

15:34:38,390 INFO at org.mobicents.slee.runtime.SbbEntity.invokeEventHandler(SbbEntity.java:1643)

15:34:38,406 INFO at org.mobicents.slee.runtime.EventRouterImpl.routeTheEvent(EventRouterImpl.java:1 158)

15:34:38,406 INFO at org.mobicents.slee.runtime.EventRouterImpl.access$100(EventRouterImpl.java:81)

15:34:38,406 INFO at org.mobicents.slee.runtime.EventRouterImpl$EventExecutor.run(EventRouterImpl.ja va:176)

15:34:38,406 INFO at EDU.oswego.cs.dl.util.concurrent.QueuedExecutor$RunLoop.run(QueuedExecutor.java :88)

15:34:38,406 INFO at java.lang.Thread.run(Thread.java:595)

I have slightly modified SASLAuthentication so lines 299-309 look like:

connection.sendPacket(bindResource);

Bind response;

// Wait up to a certain number of seconds for a response from the server.

//Packet response = collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

Object resp=collector.nextResult(SmackConfiguration.getPacketReplyTimeout());

System.out.println(“SASL RESPONSE CLASS:”+resp.getClass().toString());

Packet tmp=(Packet)resp;

System.out.println(“SASL RESPONSE CLASS:”+tmp.getClass().toString());

response=(Bind)tmp; // Line 309