Openfire is 3.3.2, client in use is Spark 2.5.6. MySQL server is 5.0.48 (according to logs seems to have happened in earlier versions too). MySQL JDBC library is the one that comes with Openfire.
Attempting to send the following (just “åäö”) to an offline user results in the following being printed to error.log and the message silently being discarded (lost). It does not matter if you send it separately or embedded into something another string of characters.
2007.09.17 21:22:15 org.jivesoftware.openfire.OfflineMessageStore.addMessage(OfflineMessageStore.jav a:139) Internal server error
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column ‘message’ at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2973)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.ja va:1125)
at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement. java:677)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1357)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1274)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1259)
at org.jivesoftware.openfire.OfflineMessageStore.addMessage(OfflineMessageStore.ja va:135)
at org.jivesoftware.openfire.OfflineMessageStrategy.store(OfflineMessageStrategy.j ava:138)
at org.jivesoftware.openfire.OfflineMessageStrategy.storeOffline(OfflineMessageStr ategy.java:98)
at org.jivesoftware.openfire.MessageRouter.routeToBareJID(MessageRouter.java:164)
at org.jivesoftware.openfire.MessageRouter.route(MessageRouter.java:100)
at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:71)
at org.jivesoftware.openfire.net.StanzaHandler.processMessage(StanzaHandler.java:3 23)
at org.jivesoftware.openfire.net.ClientStanzaHandler.processMessage(ClientStanzaHa ndler.java:91)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:186)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:153)
at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:132)
at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived (AbstractIoFilterChain.java:703)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:362)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:54)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:800)
at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimplePr otocolDecoderOutput.java:62)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:200)
at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:362)
at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:54)
at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:800)
at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :266)
at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:326)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java: 885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
I do have the following configured in openfire.xml:
which according to my understanding (and reading this site + lots of googling) should Just Make Things Work.
I looked at the jiveOffline and any message with special characters (in our case å, ä, ö, Å, Ä, Ö in the Finnish alphabet) is not stored there.
Also does not seem to make a difference if runs ALTER TABLE jiveOffline DEFAULT CHARACTER SET=UTF8.
If the server has been configured to store offline messages and is unable to store it should IMHO return something to the user indicating things got out of whack.
Any ideas on fixing, though?
Kaj