ObjectEncoder Decoder fails with Object containing Object

"이희승 (Trustin Lee)" trustin at gmail.com
Tue Jun 23 03:41:01 EDT 2009


Hi Neil,

The reported issue has been fixed already in 3.1.0.CR1.  Are you using
3.1.0.CR1?

HTH,
Trustin

On 2009-06-23 오후 3:56, neilson9 wrote:
> 
> Hi All,
> Firstly, thankyou for developing this framework - Ive have used quite a few
> in the past and netty is easy to use, has a great API and extremely fast!
> 
> I have 2 questions,
> 1) Does an Object passes using the ObjectEncoder/Decoder have to implement
> Serializable? - is there a switch to disable the check?
> 
> 2) Ive just been looking at passing through messages using the
> ObjectDecoder, ObjectEncoder and have found that if any message contains an
> field Object[] i.e. below. Is there something Im missing ? Im trying to
> proxy a data payload to the server without having to use other forms of
> serialization.
> 
> class MyClass {
> Object[] stuff 
> }
> 
> then it fails with the following message.
> 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.readArray(ObjectInputStream.java:1624)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
> 	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
> 	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.jboss.netty.handler.codec.serialization.ObjectDecoder.decode(ObjectDecoder.java:117)
> 	at
> org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:244)
> 	at
> org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:184)
> 	at
> org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:87)
> 	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:344)
> 	at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:331)
> 	at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:303)
> 	at
> org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:255)
> 	at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:176)
> 	at
> org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:49)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:637)
> Caused by: java.lang.ClassNotFoundException: [Ljava.lang.Object;
> 	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:319)
> 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
> 	at
> org.jboss.netty.handler.codec.serialization.CompactObjectInputStream.loadClass(CompactObjectInputStream.java:100)
> 	at
> org.jboss.netty.handler.codec.serialization.CompactObjectInputStream.readClassDescriptor(CompactObjectInputStream.java:74)
> 	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1565)
> 	... 21 more
> 
> 
> Many Thanks,
> -Neil.


-- 
— Trustin Lee, http://gleamynode.net/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20090623/8473b878/attachment.bin 


More information about the netty-users mailing list