]
wl chou commented on JBSER-131:
-------------------------------
Does this issue affect version 1.0.6.FINAL?
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.