powered by Jive Software

Openfire StackOverflowError

Hello,

I made a plugin for Openfire which use the Bot functionality(see Attachment). I create a virtual connection and a Bot User. This User has in his Roster some other users. Now the Problem:

When the BotUser is offline, one or more User from his Roster are online and I login the Bot User I became a Exception. Please help me to fix this problem. When I stop and start the Server everything is fine.

regards

Jens

Exception:

35548 [btpool0-2] WARN org.jivesoftware.openfire.nio.ClientConnectionHandler - [/127.0.0.1:4632] Unexpected exception from exceptionCaught handler.
35548 [btpool0-2] WARN org.jivesoftware.openfire.nio.ClientConnectionHandler - [/127.0.0.1:4632] Unexpected exception from exceptionCaught handler.
35548 [btpool0-2] WARN org.jivesoftware.openfire.nio.ClientConnectionHandler - [/127.0.0.1:4632] Unexpected exception from exceptionCaught handler.
35548 [btpool0-2] WARN org.jivesoftware.openfire.nio.ClientConnectionHandler - [/127.0.0.1:4632] Unexpected exception from exceptionCaught handler.
35548 [btpool0-2] WARN org.jivesoftware.openfire.nio.ClientConnectionHandler - [/127.0.0.1:4632] Unexpected exception from exceptionCaught handler.
java.lang.StackOverflowError
at java.nio.CharBuffer.array(Unknown Source)
at sun.nio.cs.SingleByteEncoder.encodeArrayLoop(Unknown Source)
at sun.nio.cs.SingleByteEncoder.encodeLoop(Unknown Source)
at java.nio.charset.CharsetEncoder.encode(Unknown Source)
at sun.nio.cs.StreamEncoder.implWrite(Unknown Source)
at sun.nio.cs.StreamEncoder.write(Unknown Source)
at java.io.OutputStreamWriter.write(Unknown Source)
at java.io.BufferedWriter.flushBuffer(Unknown Source)
at java.io.PrintStream.write(Unknown Source)
at java.io.PrintStream.print(Unknown Source)
at org.slf4j.impl.SimpleLogger.log(SimpleLogger.java:157)
at org.slf4j.impl.SimpleLogger.warn(SimpleLogger.java:280)
at org.apache.mina.util.SessionLog.warn(SessionLog.java:91)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(Ab stractIoFilterChain.java:348)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1000(AbstractIoFilt erChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.exceptionCaugh t(AbstractIoFilterChain.java:643)
at org.apache.mina.common.support.AbstractIoFilterChain$HeadFilter.exceptionCaught (AbstractIoFilterChain.java:494)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextExceptionCaught(Ab stractIoFilterChain.java:345)
at org.apache.mina.common.support.AbstractIoFilterChain.fireExceptionCaught(Abstra ctIoFilterChain.java:334)
at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:365)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1300(AbstractIoFilt erChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.filterWrite(Ab stractIoFilterChain.java:659)
at org.apache.mina.filter.executor.ExecutorFilter.filterWrite(ExecutorFilter.java: 255)
at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:361)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1300(AbstractIoFilt erChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.filterWrite(Ab stractIoFilterChain.java:659)
at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilte r.java:210)
at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:361)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1300(AbstractIoFilt erChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.filterWrite(Ab stractIoFilterChain.java:659)
at org.apache.mina.common.IoFilterAdapter.filterWrite(IoFilterAdapter.java:90)
at org.jivesoftware.openfire.net.StalledSessionsFilter.filterWrite(StalledSessions Filter.java:49)
at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:361)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1300(AbstractIoFilt erChain.java:53)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.filterWrite(Ab stractIoFilterChain.java:659)
at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.filterWrite(Abs tractIoFilterChain.java:587)
at org.apache.mina.common.support.AbstractIoFilterChain.callPreviousFilterWrite(Ab stractIoFilterChain.java:361)
at org.apache.mina.common.support.AbstractIoFilterChain.fireFilterWrite(AbstractIo FilterChain.java:355)
at org.apache.mina.transport.socket.nio.SocketSessionImpl.write0(SocketSessionImpl .java:166)
at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:177)
at org.apache.mina.common.support.BaseIoSession.write(BaseIoSession.java:168)
at org.jivesoftware.openfire.nio.NIOConnection.deliver(NIOConnection.java:242)
at org.jivesoftware.openfire.session.LocalClientSession.deliver(LocalClientSession .java:829)
at org.jivesoftware.openfire.session.LocalSession.process(LocalSession.java:262)
at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.jav a:236)
at org.jivesoftware.openfire.roster.Roster.broadcastPresence(Roster.java:590)
at org.jivesoftware.openfire.handler.PresenceUpdateHandler.broadcastUpdate(Presenc eUpdateHandler.java:283)
at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:124)
at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:112)
at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:176)
at org.jivesoftware.openfire.PresenceRouter.handle(PresenceRouter.java:134)
at org.jivesoftware.openfire.PresenceRouter.route(PresenceRouter.java:70)
at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:76)
at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:11 2)
at org.jivesoftware.openfire.SessionPacketRouter.route(SessionPacketRouter.java:94 )
at org.jivesoftware.openfire.botz.BotzConnection.sendPacket(BotzConnection.java:39 3)
at org.jivesoftware.openfire.kpath.KPathBotPacketReceiver.processIncoming(KPathBot PacketReceiver.java:101)
at org.jivesoftware.openfire.botz.BotzConnection.deliver(BotzConnection.java:147)
at org.jivesoftware.openfire.session.LocalClientSession.deliver(LocalClientSession .java:829)
at org.jivesoftware.openfire.session.LocalSession.process(LocalSession.java:262)
at org.jivesoftware.openfire.spi.RoutingTableImpl.routePacket(RoutingTableImpl.jav a:236)
at org.jivesoftware.openfire.net.SocketPacketWriteHandler.process(SocketPacketWrit eHandler.java:53)
at org.jivesoftware.openfire.spi.PacketDelivererImpl.deliver(PacketDelivererImpl.j ava:48)
at org.jivesoftware.openfire.spi.PresenceManagerImpl.probePresence(PresenceManager Impl.java:388)
at org.jivesoftware.openfire.handler.PresenceUpdateHandler.initSession(PresenceUpd ateHandler.java:230)
at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:128)
at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:112)
at org.jivesoftware.openfire.handler.PresenceUpdateHandler.process(PresenceUpdateH andler.java:176)
at org.jivesoftware.openfire.PresenceRouter.handle(PresenceRouter.java:134)
at org.jivesoftware.openfire.PresenceRouter.route(PresenceRouter.java:70)

I have almost similar issue ,

I have utilized BotzConnection class in openfire 3.9.1 version and it was working perfectly !!! , but when I tried with version 4.0.2 , I got the following error :

2016.11.02 16:48:38 org.jivesoftware.openfire.container.PluginManager - Error loading plugin: E:\ramshu\Projects\openfire_4\Test\openfire_4.0.3\target\openfire\plugins\petro linkchatbot

java.lang.NoSuchMethodError: org.jivesoftware.openfire.XMPPServerInfo.getName()Ljava/lang/String;

at org.jivesoftware.openfire.botz.BotzConnection.login(BotzConnection.java:319)

at org.jivesoftware.openfire.botz.BotzConnection.login(BotzConnection.java:272)

at org.jivesoftware.openfire.plugin.ChatBot.initializePlugin(ChatBot.java:126)

at org.jivesoftware.openfire.container.PluginManager.loadPlugin(PluginManager.java :447)

at org.jivesoftware.openfire.container.PluginManager.access$1(PluginManager.java:2 63)

at org.jivesoftware.openfire.container.PluginManager$PluginMonitor.run(PluginManag er.java:1037)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301 (ScheduledThreadPoolExecutor.java:180)

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Schedu ledThreadPoolExecutor.java:294)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

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

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

where , petrolinkchatbot is the customized name of the plugin.

Please help , Thank you