powered by Jive Software

XMPPConnection disconnecting

Hi all,

I can successfully create a connection to the Openfire server, but when i create a Chat object and send a message, the connection is closed. I have implemented the ConnectionListener interface, and it indicates that the connection is closing with no errors. Anyone have any ideas why the connection would be closing?

Chris

Turn the loglevel in Openfire to debugging and also in your client, and see what packets are sent and if any side is having trouble. Sometimes an uncaught Exception, like NullPointerException, can cause a silent loss of connectivity…

Hi,

Thanks for the response. What do you mean by “also in your client”. Thanks

Chris

Here is the error i get from openfire? Any taughts?

Closing connection due to error while processing message: <message id=“3Ogkg-4” to=“ccrane.personainternet.com.minutefix.com/TechMgr@minutefix.com”><body>Hello from TechMgr</body></message>

java.lang.StringIndexOutOfBoundsException: String index out of range: -9

at java.lang.String.substring(Unknown Source)

at org.xmpp.packet.JID.getParts(JID.java:309)

at org.xmpp.packet.Packet.<init>(Packet.java:77)

at org.xmpp.packet.Message.<init>(Message.java:59)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:187)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:167)

at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:132)

at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived (AbstractIoFilterChain.java:570)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimplePr otocolDecoderOutput.java:58)

at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:162)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :240)

at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:284)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

ccrane wrote:

to=“ccrane.personainternet.com.minutefix.com/TechMgr@minutefix.com

This looks like an invalid JID, it looks as if the user and resource have been swapped around.

Here is the XMPP standards definition:

http://www.xmpp.org/rfcs/rfc3920.html#addressing

Thanks, that was the problem.

Chris