[jboss-jira] [JBoss JIRA] (JBSER-131) ConcurrentHashMap deserialization fails with JDK 7

Constantine Nosovsky (JIRA) jira-events at lists.jboss.org
Mon Jul 8 05:22:20 EDT 2013


     [ https://issues.jboss.org/browse/JBSER-131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Constantine Nosovsky updated JBSER-131:
---------------------------------------

    Description: 
java.util.concurrent.ConcurrentHashMap deserialization fails with java 7 runtime with the following error:

Caused by: java.lang.RuntimeException: Unexpected datatype 28
	at org.jboss.serial.objectmetamodel.FieldsContainer.readField(FieldsContainer.java:181)
	at org.jboss.serial.objectmetamodel.FieldsContainer.readMyself(FieldsContainer.java:218)
	at org.jboss.serial.persister.ObjectInputStreamProxy.readFields(ObjectInputStreamProxy.java:224)
	at java.util.concurrent.ConcurrentHashMap.readObject(ConcurrentHashMap.java:1540)

Here is the unit test to reproduce the issue (just added to the ReadObjectTestCase)
{code}
public void testCHMapOnJBossSerialization() throws Exception
    {
        ConcurrentHashMap<Object, Object> chm = new ConcurrentHashMap<Object, Object>();
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        JBossObjectOutputStream objout = new JBossObjectOutputStream(bout);
        objout.writeObject(chm);
        objout.flush();

        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
        JBossObjectInputStream objinput = new JBossObjectInputStream(bin);
        ConcurrentHashMap<Object, Object> newObject = (ConcurrentHashMap<Object, Object>)objinput.readObject();
        assertTrue(chm.equals(newObject));
    }
{code}

Originally occurred with 1.0.3 version, but the latest trunk revision (448) has the same issue.

  was:
java.util.concurrent.ConcurrentHashMap deserialization fails with java 7 runtime with the following error:

Caused by: java.lang.RuntimeException: Unexpected datatype 28
	at org.jboss.serial.objectmetamodel.FieldsContainer.readField(FieldsContainer.java:181)
	at org.jboss.serial.objectmetamodel.FieldsContainer.readMyself(FieldsContainer.java:218)
	at org.jboss.serial.persister.ObjectInputStreamProxy.readFields(ObjectInputStreamProxy.java:224)
	at java.util.concurrent.ConcurrentHashMap.readObject(ConcurrentHashMap.java:1540)

Originally occurred with 1.0.3 version, but the latest trunk revision (448) has the same issue.


    
> ConcurrentHashMap deserialization fails with JDK 7
> --------------------------------------------------
>
>                 Key: JBSER-131
>                 URL: https://issues.jboss.org/browse/JBSER-131
>             Project: JBoss Serialization
>          Issue Type: Bug
>    Affects Versions: 1.1.0 Beta
>         Environment: jdk1.7.0_21 and jdk1.7.0_25 64-bit
>            Reporter: Constantine Nosovsky
>            Assignee: Clebert Suconic
>
> java.util.concurrent.ConcurrentHashMap deserialization fails with java 7 runtime with the following error:
> Caused by: java.lang.RuntimeException: Unexpected datatype 28
> 	at org.jboss.serial.objectmetamodel.FieldsContainer.readField(FieldsContainer.java:181)
> 	at org.jboss.serial.objectmetamodel.FieldsContainer.readMyself(FieldsContainer.java:218)
> 	at org.jboss.serial.persister.ObjectInputStreamProxy.readFields(ObjectInputStreamProxy.java:224)
> 	at java.util.concurrent.ConcurrentHashMap.readObject(ConcurrentHashMap.java:1540)
> Here is the unit test to reproduce the issue (just added to the ReadObjectTestCase)
> {code}
> public void testCHMapOnJBossSerialization() throws Exception
>     {
>         ConcurrentHashMap<Object, Object> chm = new ConcurrentHashMap<Object, Object>();
>         ByteArrayOutputStream bout = new ByteArrayOutputStream();
>         JBossObjectOutputStream objout = new JBossObjectOutputStream(bout);
>         objout.writeObject(chm);
>         objout.flush();
>         ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
>         JBossObjectInputStream objinput = new JBossObjectInputStream(bin);
>         ConcurrentHashMap<Object, Object> newObject = (ConcurrentHashMap<Object, Object>)objinput.readObject();
>         assertTrue(chm.equals(newObject));
>     }
> {code}
> Originally occurred with 1.0.3 version, but the latest trunk revision (448) has the same issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list