Hi,
in my application i am using
*chain.addLast("readExecutor", new ExecutorFilter(new
OrderedThreadPoolExecutor(), IoEventType.MESSAGE_RECEIVED));
chain.addLast("codec", new ProtocolCodecFilter(new
FlashCrossdomainCodec()));
//OrderedThreadPoolExecutor writerThreadPool = new
OrderedThreadPoolExecutor();
chain.addLast("writeExecutor", new ExecutorFilter(new
**OrderedThreadPoolExecutor(),
IoEventType.WRITE));*
and i receive a lot of this *ProtocolDecoderException*
*org.apache.mina.filter.codec.ProtocolDecoderException*:
java.lang.NullPointerException (Hexdump: 3C 72 65 73 70 6F 6E 73 65 20 61 3D
22 6C 65 61 76 65 47 61 6D 65 22 20 74 3D 22 6C 71 4F 74 4E 73 42 6E 67 78
62 5A 65 72 4B 4D 55 6A 55 73 46 4B 52 6D 6A 42 53 31 5A 4E 41 61 22 20 74
62 6C 3D 22 33 22 20 70 6C 72 3D 22 31 31 37 34 33 22 3E 3C 6C 65 61 76 65
47 61 6D 65 2F 3E 3C 2F 72 65 73 70 6F 6E 73 65 3E 0A 00)
Caused by: java.lang.NullPointerException
*14:10:21,167 ERROR {pool-3-thread-8}* Connector:20 - exceptionCaught :
(0x00000125: nio socket, server, null => /208.10.135.175:64172) -
java.lang.NullPointerException (Hexdump: 3C 72 65 73 70 6F 6E 73 65 20 61 3D
22 67 65 74 4C 69 73 74 54 61 62 6C 65 73 22 20 74 3D 22 45 79 68 4E 36 56
6B 49 77 65 55 6F 45 48 47 44 34 7A 75 58 73 49 42 58 75 79 63 4C 57 42 33
74 22 20 70 6C 72 3D 22 31 30 35 35 33 22 20 72 6F 6F 6D 3D 22 30 22 2F 3E
0A 00)
*org.apache.mina.filter.codec.ProtocolDecoderException*:
java.lang.NullPointerException (Hexdump: 3C 72 65 73 70 6F 6E 73 65 20 61 3D
22 67 65 74 4C 69 73 74 54 61 62 6C 65 73 22 20 74 3D 22 45 79 68 4E 36 56
6B 49 77 65 55 6F 45 48 47 44 34 7A 75 58 73 49 42 58 75 79 63 4C 57 42 33
74 22 20 70 6C 72 3D 22 31 30 35 35 33 22 20 72 6F 6F 6D 3D 22 30 22 2F 3E
0A 00)
Caused by: java.lang.NullPointerException
and my decoder is:
*
public class FlashCrossdomainDecoder extends CumulativeProtocolDecoder {
protected CharsetDecoder decoder;
private static final Logger log =
LoggerFactory.getLogger(FlashCrossdomainDecoder.class);
public FlashCrossdomainDecoder() {
//decoder = Charset.forName("UTF-8").newDecoder();
decoder = Charset.defaultCharset().newDecoder();
}
@Override
protected boolean doDecode(IoSession session, IoBuffer in,
ProtocolDecoderOutput out) throws Exception {
int start = in.position();
while (in.hasRemaining()) {
byte current = in.get();
if (current == '\0') {
int position = in.position();
int limit = in.limit();
try {
in.position(start);
in.limit(position);
String res = (in.slice().getString(this.decoder));
out.write(res);
log.debug("[doDecode] SENT=" + res.trim());
} finally {
in.position(position);
in.limit(limit);
}
return true;
}
}
in.position(start);
return false;
}
}*
do you think something is wrong ?
Thanks for your work, it is amazing
Francesco