I debug in my mina server : and find exception: org.apache.mina.common.BufferDataException: java.io.InvalidClassException: failed to read class descriptor at org.apache.mina.common.ByteBuffer.getObject(ByteBuffer.java:1487) at org.apache.mina.filter.codec.serialization.ObjectSerializationDecoder.doDecode(ObjectSerializationDecoder.java:92) at org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:133) at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:159) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilterChain.java:53) at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(AbstractIoFilterChain.java:648) at org.apache.mina.common.support.AbstractIoFilterChain$HeadFilter.messageReceived(AbstractIoFilterChain.java:499) at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java:299) at org.apache.mina.common.support.AbstractIoFilterChain.fireMessageReceived(AbstractIoFilterChain.java:293) at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(SocketIoProcessor.java:218) at org.apache.mina.transport.socket.nio.SocketIoProcessor.process(SocketIoProcessor.java:188) at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$400(SocketIoProcessor.java:44) at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:464) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51) 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) Caused by: java.io.InvalidClassException: failed to read class descriptor at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1567) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) at java.io.ObjectInputStream.readClass(ObjectInputStream.java:1462) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1312) at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at java.util.HashMap.readObject(HashMap.java:1030) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.apache.mina.common.ByteBuffer.getObject(ByteBuffer.java:1485) ... 17 more Caused by: java.lang.ClassNotFoundException: long at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.apache.mina.common.ByteBuffer$3.readClassDescriptor(ByteBuffer.java:1480) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1565) ... 42 more
tiandike wrote: > > I use ObjectSerializationCodecFactory in my mina server and client app . > > I define a Map field in my requestmessage and in this Map i put Object[] > args and Class[] clazzes; > in the first bytebuffer I use Long ,but the seconde bytebuffer i use > long. > > I find first bytebuffer can be sent to mina server, but the second can't . > first > DirectBuffer[pos=0 lim=440 cap=512: 00 00 01 B4 AC ED 00 05 73 72 00 34 63 > 6F 6D 2E 74 61 6F 62 61 6F 2E 75 69 63 2E 74 68 75 6E 64 65 72 62 69 72 64 > 2E 6D 65 73 73 61 67 65 2E 44 65 66 61 75 6C 74 55 49 43 52 65 71 75 65 73 > 74 78 72 00 35 63 6F 6D 2E 74 61 6F 62 61 6F 2E 75 69 63 2E 74 68 75 6E 64 > 65 72 62 69 72 64 2E 6D 65 73 73 61 67 65 2E 41 62 73 74 72 61 63 74 55 49 > 43 4D 65 73 73 61 67 65 78 70 73 72 00 11 6A 61 76 61 2E 75 74 69 6C 2E 48 > 61 73 68 4D 61 70 78 70 3F 40 00 00 00 00 00 0C 77 08 00 00 00 10 00 00 00 > 01 74 00 0D 5F 64 65 66 61 75 6C 74 4D 6F 64 65 6C 73 72 00 26 63 6F 6D 2E > 74 61 6F 62 61 6F 2E 75 69 63 2E 63 6C 61 77 2E 63 6C 69 65 6E 74 2E 43 6C > 61 77 43 6F 6E 74 65 78 74 78 70 74 00 07 67 65 74 44 61 74 61 75 72 00 13 > 5B 4C 6A 61 76 61 2E 6C 61 6E 67 2E 4F 62 6A 65 63 74 3B 78 70 00 00 00 02 > 73 72 00 0E 6A 61 76 61 2E 6C 61 6E 67 2E 4C 6F 6E 67 78 72 00 10 6A 61 76 > 61 2E 6C 61 6E 67 2E 4E 75 6D 62 65 72 78 70 00 00 00 00 07 39 89 4C 74 00 > 12 64 61 74 61 2D 69 6E 66 6F 2D 75 73 65 72 64 61 74 61 75 72 00 12 5B 4C > 6A 61 76 61 2E 6C 61 6E 67 2E 43 6C 61 73 73 3B 78 70 00 00 00 02 76 72 00 > 04 6C 6F 6E 67 78 70 76 72 00 10 6A 61 76 61 2E 6C 61 6E 67 2E 53 74 72 69 > 6E 67 78 70 78 73 71 00 7E 00 0B 00 00 00 00 00 00 00 01 01 70 74 00 08 75 > 73 65 72 64 61 74 61 74 00 0F 75 73 65 72 44 61 74 61 53 65 72 76 69 63 65 > 70 70] > second > DirectBuffer[pos=0 lim=436 cap=512: 00 00 01 B0 AC ED 00 05 73 72 00 34 63 > 6F 6D 2E 74 61 6F 62 61 6F 2E 75 69 63 2E 74 68 75 6E 64 65 72 62 69 72 64 > 2E 6D 65 73 73 61 67 65 2E 44 65 66 61 75 6C 74 55 49 43 52 65 71 75 65 73 > 74 78 72 00 35 63 6F 6D 2E 74 61 6F 62 61 6F 2E 75 69 63 2E 74 68 75 6E 64 > 65 72 62 69 72 64 2E 6D 65 73 73 61 67 65 2E 41 62 73 74 72 61 63 74 55 49 > 43 4D 65 73 73 61 67 65 78 70 73 72 00 11 6A 61 76 61 2E 75 74 69 6C 2E 48 > 61 73 68 4D 61 70 78 70 3F 40 00 00 00 00 00 0C 77 08 00 00 00 10 00 00 00 > 01 74 00 0D 5F 64 65 66 61 75 6C 74 4D 6F 64 65 6C 73 72 00 26 63 6F 6D 2E > 74 61 6F 62 61 6F 2E 75 69 63 2E 63 6C 61 77 2E 63 6C 69 65 6E 74 2E 43 6C > 61 77 43 6F 6E 74 65 78 74 78 70 74 00 07 67 65 74 44 61 74 61 75 72 00 13 > 5B 4C 6A 61 76 61 2E 6C 61 6E 67 2E 4F 62 6A 65 63 74 3B 78 70 00 00 00 02 > 73 72 00 0E 6A 61 76 61 2E 6C 61 6E 67 2E 4C 6F 6E 67 78 72 00 10 6A 61 76 > 61 2E 6C 61 6E 67 2E 4E 75 6D 62 65 72 78 70 00 00 00 00 07 39 89 4C 74 00 > 12 64 61 74 61 2D 69 6E 66 6F 2D 75 73 65 72 64 61 74 61 75 72 00 12 5B 4C > 6A 61 76 61 2E 6C 61 6E 67 2E 43 6C 61 73 73 3B 78 70 00 00 00 02 76 71 00 > 7E 00 0B 76 72 00 10 6A 61 76 61 2E 6C 61 6E 67 2E 53 74 72 69 6E 67 78 70 > 78 73 71 00 7E 00 0B 00 00 00 00 00 00 00 01 01 70 74 00 08 75 73 65 72 64 > 61 74 61 74 00 0F 75 73 65 72 44 61 74 61 53 65 72 76 69 63 65 70 70] > > ///////////////////// > in SocketIoProcessor doFlush(SocketSessionImpl session) , i find the code > below are executed in these two condition. > > if (key.isWritable()) { > writtenBytes += ch.write(buf.buf()); > } > > I don't know why! it's so strange! > > -- View this message in context: http://www.nabble.com/a-question-about-codec.serialization-tf4801841s16868.html#a13739039 Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.