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

Brad Maxwell (JIRA) issues at jboss.org
Tue Oct 14 11:13:35 EDT 2014


    [ https://issues.jboss.org/browse/JBSER-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011639#comment-13011639 ] 

Brad Maxwell commented on JBSER-131:
------------------------------------

Likely a duplicate of https://issues.jboss.org/browse/JBSER-128

> 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 was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the jboss-jira mailing list