You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Owen Jacobson (JIRA)" <ji...@apache.org> on 2008/10/03 05:40:44 UTC
[jira] Created: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
---------------------------------------------------------------------------------
Key: DIRMINA-627
URL: https://issues.apache.org/jira/browse/DIRMINA-627
Project: MINA
Issue Type: Bug
Components: Core
Affects Versions: 1.1.7
Reporter: Owen Jacobson
Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
public interface NotSerializable {}
/*...*/
ObjectOutputStream o = /*...*/;
o.writeObject (NotSerializable.class);
/*...*/
ObjectInputStream i = /*..bytes written by o, above..*/;
Object read = i.readObject();
The 'read' object will be NotSerializable.class.
Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
wangzhenghang updated DIRMINA-627:
----------------------------------
Attachment: IoBufferTest.java
AbstractIoBuffer.java
This bug can be easly to fixed. Serializable object can be divide into three types:
a)Class instances representing classes that are not serializable
b)Primitive objects
c)Other serializable objects.
The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
[ Show ? ]
wangzhenghang added a comment - 15/Apr/09 06:14 AM - edited This bug can be easly to fixed. Serializable object can be divide into three types: a)Class instances representing classes that are not serializable b)Primitive objects c)Other serializable objects. The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: AbstractIoBuffer.java, fix.patch, IoBufferTest.java, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
wangzhenghang updated DIRMINA-627:
----------------------------------
Attachment: (was: IoBufferTest.java)
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: fix.patch, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (DIRMINA-627) ByteBuffer.getObject()
doesn't support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699183#action_12699183 ]
wangzhenghang edited comment on DIRMINA-627 at 4/15/09 6:25 AM:
----------------------------------------------------------------
This bug can be easly to fixed. Serializable object can be divide into three types:
a)Class instances representing classes that are not serializable
b)Primitive objects
c)Other serializable objects.
The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
was (Author: passerbya):
This bug can be easly to fixed. Serializable object can be divide into three types:
a)Class instances representing classes that are not serializable
b)Primitive objects
c)Other serializable objects.
The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase.
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: fix.patch, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
wangzhenghang updated DIRMINA-627:
----------------------------------
Attachment: IoBufferTest.java
AbstractIoBuffer.java
This bug can be easly to fixed. Serializable object can be divide into three types:
a)Class instances representing classes that are not serializable
b)Primitive objects
c)Other serializable objects.
The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase.
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: AbstractIoBuffer.java, fix.patch, IoBufferTest.java, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
wangzhenghang updated DIRMINA-627:
----------------------------------
Comment: was deleted
(was: This bug can be easly to fixed. Serializable object can be divide into three types:
a)Class instances representing classes that are not serializable
b)Primitive objects
c)Other serializable objects.
The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
[ Show ? ]
wangzhenghang added a comment - 15/Apr/09 06:14 AM - edited This bug can be easly to fixed. Serializable object can be divide into three types: a)Class instances representing classes that are not serializable b)Primitive objects c)Other serializable objects. The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
)
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: fix.patch, IoBufferTest.java, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
wangzhenghang updated DIRMINA-627:
----------------------------------
Comment: was deleted
(was: This bug can be easly to fixed. Serializable object can be divide into three types:
a)Class instances representing classes that are not serializable
b)Primitive objects
c)Other serializable objects.
The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
[ Show ? ]
wangzhenghang added a comment - 15/Apr/09 06:14 AM - edited This bug can be easly to fixed. Serializable object can be divide into three types: a)Class instances representing classes that are not serializable b)Primitive objects c)Other serializable objects. The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
)
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: AbstractIoBuffer.java, fix.patch, IoBufferTest.java, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
wangzhenghang updated DIRMINA-627:
----------------------------------
Comment: was deleted
(was: This bug can be easly to fixed. Serializable object can be divide into three types:
a)Class instances representing classes that are not serializable
b)Primitive objects
c)Other serializable objects.
The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
)
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: fix.patch, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
wangzhenghang updated DIRMINA-627:
----------------------------------
Attachment: (was: IoBufferTest.java)
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: fix.patch, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
wangzhenghang updated DIRMINA-627:
----------------------------------
Attachment: (was: AbstractIoBuffer.java)
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: fix.patch, IoBufferTest.java, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
wangzhenghang updated DIRMINA-627:
----------------------------------
Attachment: (was: AbstractIoBuffer.java)
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: fix.patch, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Emmanuel Lecharny updated DIRMINA-627:
--------------------------------------
Fix Version/s: 3.0.0-M1
I _think_ that's belong to 3.0. Anyway, we will have most certainly a better way to handle buffers in 3.0
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: fix.patch, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
wangzhenghang updated DIRMINA-627:
----------------------------------
Attachment: (was: AbstractIoBuffer.java)
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: fix.patch, IoBufferTest.java, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (DIRMINA-627) ByteBuffer.getObject()
doesn't support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699213#action_12699213 ]
wangzhenghang edited comment on DIRMINA-627 at 4/15/09 7:20 AM:
----------------------------------------------------------------
This bug can be easly to fixed. Serializable object can be divide into three types:
a)Class instances representing classes that are not serializable
b)Primitive objects
c)Other serializable objects.
The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
was (Author: passerbya):
This bug can be easly to fixed. Serializable object can be divide into three types:
a)Class instances representing classes that are not serializable
b)Primitive objects
c)Other serializable objects.
The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
[ Show ? ]
wangzhenghang added a comment - 15/Apr/09 06:14 AM - edited This bug can be easly to fixed. Serializable object can be divide into three types: a)Class instances representing classes that are not serializable b)Primitive objects c)Other serializable objects. The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: AbstractIoBuffer.java, fix.patch, IoBufferTest.java, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
wangzhenghang updated DIRMINA-627:
----------------------------------
Attachment: IoBufferTest.java
AbstractIoBuffer.java
This bug can be easly to fixed. Serializable object can be divide into three types:
a)Class instances representing classes that are not serializable
b)Primitive objects
c)Other serializable objects.
The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
[ Show ? ]
wangzhenghang added a comment - 15/Apr/09 06:14 AM - edited This bug can be easly to fixed. Serializable object can be divide into three types: a)Class instances representing classes that are not serializable b)Primitive objects c)Other serializable objects. The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: AbstractIoBuffer.java, fix.patch, IoBufferTest.java, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
wangzhenghang updated DIRMINA-627:
----------------------------------
Attachment: (was: IoBufferTest.java)
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: fix.patch, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "Owen Jacobson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Owen Jacobson updated DIRMINA-627:
----------------------------------
Attachment: fix.patch
I've attached a (trivial) fix for the problem.
I'm a little dubious of the value of the "optimization" to OOS/OIS' protocols. I did a few ad-hoc tests with it and never got more than a 5% saving on byte size. Wouldn't it be a better idea, if we're concerned about data size, to use a normal OOS/OIS pair plus a GzipStream or similar? Less risk of introducing protocol quirks like this issue and DIRMINA-481...
Protocol optimizations should be left up to things in the ProtocolCodec or filter stack.
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Attachments: fix.patch, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "Owen Jacobson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Owen Jacobson updated DIRMINA-627:
----------------------------------
Attachment: tests.patch
I've attached a patch to ByteBufferTest that both validates my assertion about OOS/OIS and exercises ByteBuffer, with a class's Class and an interface's Class.
I ran into this doing some remoting (using Camel) over Mina: Camel's MethodInvocation message includes the class object for the method, which in turn includes the class object for the interface it's defined on.
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Attachments: tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DIRMINA-627) ByteBuffer.getObject() doesn't
support Class objects for non-serializable classes
Posted by "wangzhenghang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRMINA-627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
wangzhenghang updated DIRMINA-627:
----------------------------------
Attachment: IoBufferTest.java
AbstractIoBuffer.java
This bug can be easly to fixed. Serializable object can be divide into three types:
a)Class instances representing classes that are not serializable
b)Primitive objects
c)Other serializable objects.
The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
[ Show ? ]
wangzhenghang added a comment - 15/Apr/09 06:14 AM - edited This bug can be easly to fixed. Serializable object can be divide into three types: a)Class instances representing classes that are not serializable b)Primitive objects c)Other serializable objects. The first tow types's ClassDescriptor should be written, the third one just write its class name. The attachments are AbstractIoBuffer.java fixed by me and a testCase. The attachments are about mina-2.0.0-M5, it's the same way to fixed this bug in mina-1.1.7.
> ByteBuffer.getObject() doesn't support Class objects for non-serializable classes
> ---------------------------------------------------------------------------------
>
> Key: DIRMINA-627
> URL: https://issues.apache.org/jira/browse/DIRMINA-627
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.7
> Reporter: Owen Jacobson
> Fix For: 3.0.0-M1
>
> Attachments: AbstractIoBuffer.java, fix.patch, IoBufferTest.java, tests.patch
>
>
> Instances of java.lang.Class are serializable, whether or not the class they represent is serializable. However, org.apache.mina.common.ByteBuffer's optimizations prevent it from unserializing Class instances representing classes that are not serializable. For example, given
> public interface NotSerializable {}
> /*...*/
> ObjectOutputStream o = /*...*/;
> o.writeObject (NotSerializable.class);
> /*...*/
> ObjectInputStream i = /*..bytes written by o, above..*/;
> Object read = i.readObject();
> The 'read' object will be NotSerializable.class.
> Trying the same thing with buffer.putObject (NotSerializable.class); buffer.flip(); buffer.getObject() throws a NullPointerException.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.