openfire: 3.6.0 alpha
sparkWeb: the latest code
senario:
start the sparkweb to connect to the openfire.
sparkweb will send
<?xml version="1.0"?>to openfire.
then openfire will throw exception:
org.apache.mina.filter.codec.ProtocolDecoderException: java.lang.Exception: Disallowed character
please see the exception dump stack.
2008.08.10 04:06:09 Closing session due to exception: (SOCKET, R: /127.0.0.1:50372, L: /127.0.0.1:5222, S: 0.0.0.0/0.0.0.0:5222)
org.apache.mina.filter.codec.ProtocolDecoderException: java.lang.Exception: Disallowed character (Hexdump: 3C 3F 78 6D 6C 20 76 65 72 73 69 6F 6E 3D 22 31 2E 30 22 3F 3E 3C 66 6C 61 73 68 3A 73 74 72 65 61 6D 20 74 6F 3D 22 6C 6F 63 61 6C 68 6F 73 74 22 20 78 6D 6C 6E 73 3D 22 6A 61 62 62 65 72 3A 63 6C 69 65 6E 74 22 20 78 6D 6C 6E 73 3A 66 6C 61 73 68 3D 22 68 74 74 70 3A 2F 2F 77 77 77 2E 6A 61 62 62 65 72 2E 63 6F 6D 2F 73 74 72 65 61 6D 73 2F 66 6C 61 73 68 22 20 76 65 72 73 69 6F 6E 3D 22 31 2E 30 22 20 2F 3E 00)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:170)
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)
Caused by: java.lang.Exception: Disallowed character
at org.jivesoftware.openfire.nio.XMLLightweightParser.read(XMLLightweightParser.ja va:210)
at org.jivesoftware.openfire.nio.XMPPDecoder.doDecode(XMPPDecoder.java:32)
at org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtoco lDecoder.java:133)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:163)
… 9 more
that in code org.jivesoftware.openfire.nio.XMLLightweightParser.read(XMLLightweightParser.ja va:210)
ch = buf[i];
if (ch < 0x20 && ch != 0x9 && ch != 0xA && ch != 0xD) {
//Unicode characters in the range 0x0000-0x001F other than 9, A, and D are not allowed in XML
throw new Exception(“Disallowed character”);
}
I don’t know why the last code is 0x00 always.
then the character is rejected here and connection is closed.
i compare this code with version 3.5.2 and find that this assertion is inserted in 3.6.0.
and version 3.5.2 works fine.