Connection lost to server using my spark plugin

Hi,

I have the following environment:

  • JRE 1.5.0_06

  • Spark Client 2_5_8 without JRE

  • I implemented the plugin using the JDK 1.5.0_12

Without my Plugin the spark Client runs trouble-free.

But when I use my plugin and restart the spark Client, the server closes the connection to this client in approx. 10 secs after successful login. The openfire server receives a message such as <message id=“KCx-234”></message> and closes the connection due to an error while processing this message.

Upgrading the JRE 1.5.0_06 to the JRE 1.5.0_12 or higher doesn’t solve the problem.

But use of a spark distribution with JRE (1.6.0_01) or upgrading the JRE 1.5.0_06 to 1.6.0_01 solves the problem.

May be that the use of 1.6.0_01 or higher is a requirement to use additional plugins within Spark_2_5_8?

Is there something else to do with my plugin to get working with JRE 1.5.0_xx?

Thanks in advance,

Abdeltif Nouqrat

Have you checked your Spark and Openfire error logs.

The Openfire error log file shows an error message: the server closes the connection due to an error while processing a message such as <message id=“KCx-564”></message>

The spark error log file contains no information about any errors regarding this error.

There are 2 levels of spark errors. One in the program’s folder the other is in the users profile folder in a spark folder.

This is the exact error message at openfire side.

2008.04.01 10:40:56 org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandle r.java:134)

Closing connection due to error while processing message: <message id=“K0qQ3-28”></message>

java.lang.NullPointerException

at org.jivesoftware.openfire.MessageRouter.routingFailed(MessageRouter.java:183)

at org.jivesoftware.openfire.MessageRouter.route(MessageRouter.java:99)

at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:71)

at org.jivesoftware.openfire.net.StanzaHandler.processMessage(StanzaHandler.java:3 39)

at org.jivesoftware.openfire.net.ClientStanzaHandler.processMessage(ClientStanzaHa ndler.java:90)

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

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:173)

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.common.IoFilterAdapter.messageReceived(IoFilterAdapter.java:80)

at org.jivesoftware.openfire.plugin.RawPrintFilter.messageReceived(RawPrintFilter. java:48)

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 :239)

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

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 650)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)

at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)

at java.lang.Thread.run(Thread.java:595)

The message <message id=“K0qQ3-28”></message> is not sent from my my plugin.

At spark side the following error can be shown:

01.04.2008 10:40:06 org.jivesoftware.spark.util.log.Log error

SCHWERWIEGEND:

java.lang.IllegalStateException: Not connected to server.

at org.jivesoftware.smack.XMPPConnection.addPacketListener(XMPPConnection.java:683 )

at org.jivesoftware.sparkplugin.JinglePlugin.addPresenceListener(JinglePlugin.java :283)

at org.jivesoftware.sparkplugin.JinglePlugin.initialize(JinglePlugin.java:140)

at org.jivesoftware.spark.PluginManager$1.run(PluginManager.java:404)

at java.awt.event.InvocationEvent.dispatch(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)

Any Idea?

Thanks

What is your plugin supposed to do? With it installed you are getting a NPE error, meaning a specified required variable is not present.

My Plugin sends at initialize time some XMPP messages from the current user to a specific smack client (agent@domain), which handles this messages.

That means the message should show as follows: <message id=“xxxxx” from=“currentUser@domain” to=“agent@domain”><PacketExtension></PacketExtension></messag e>

BUT: The message received from Openfire shows as follows: <message id=“xxxxx”></message> without from and to attributes.

Therefore the MessageRouter throws an NPE error at MessageRouter.java:183