Openfire 3.6.0 does not accept policy file requests on 5222 port

This is a cross-post from the XIFF discussions.

pacinoj wrote:

I’m using openfire 3.6.0a with XIFF 3.0 beta1 and I am unable to connect due to flash’s policy file. It does not appear that the crossdomain.xml file is being server over port 5222. It works fine when loading the security policy from 5229 but when I remove that line I the policy error. Is there anything special I need to do when connecting?

connection = new XMPPSocketConnection();
/onnection.addEventListener(ConnectionSuccessEvent.CONNECT_SUCCESS, onConnectSuccess);
connection.addEventListener(DisconnectionEvent.DISCONNECT, onDisconnect);
connection.addEventListener(XIFFErrorEvent.XIFF_ERROR, onXiffError);
connection.addEventListener(LoginEvent.LOGIN, onLogin);
connection.addEventListener(MessageEvent.MESSAGE, onMessage);
connection.addEventListener(PresenceEvent.PRESENCE, onPresence);
connection.addEventListener(IncomingDataEvent.INCOMING_DATA, onIncomingData);

connection.useAnonymousLogin = true;
connection.server = server.toString();
connection.port = port;
connection.resource = resourceName;
connection.connect(“flash”);

Thanks for you help!

The crossdomain.xml is served at port 5222 but it seems the patch made for Openfire 3.5.2 and discussed here [PATCH] Allow Openfire to serve cross-domain policy on client port for Flash was broken in 3.6.0. There is a snapshot from the warn.log relating to this issue.

2008.10.10 10:47:55 Closing session due to exception: (SOCKET, R: /192.168.0.145:36499, L: /192.168.0.145:5222, S: 0.0.0.0/0.0.0.0:5222)
org.apache.mina.filter.codec.ProtocolDecoderException: java.lang.Exception: Disallowed character (Hexdump: 3C 70 6F 6C 69 63 79 2D 66 69 6C 65 2D 72 65 71 75 65 73 74 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(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)
at java.lang.Thread.run(Unknown Source)
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

By the specification string must end with \0 character but the protocol codec does not understand this character.