java.lang.ClassCastException: org.jboss.serial.finalcontainers.IntegerContainer
incompatible with org.jboss.serial.finalcontainers.FloatContainer java.util.Properties IBM
AIX JDK 1.5_10
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: JBSER-118
URL:
https://jira.jboss.org/jira/browse/JBSER-118
Project: JBoss Serialization
Issue Type: Bug
Affects Versions: 1.0.3 GA
Environment: AIX 5.3.0.0
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pap32dev-20090707 (SR10 ))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc-32 j9vmap3223-20090707 (JIT enabled)
J9VM - 20090706_38445_bHdSMr
JIT - 20090623_1334_r8
GC - 200906_09)
JCL - 20090705
Reporter: Rene Felder
Assignee: Clebert Suconic
There is a problem using the jboss-serialization when upgrading from JDK 1.5_08 to JDK
1.5_10 on AIX. jboss-serialization wants to read a float but gets an integer (see
Stacktrace). The problem only occurs if we use a java.util.Properties Class within an EJB
3 Call. If we remove the java.util.Properties everything works fine.
When digging into the source code we found out that the problem occurs because
java.util.Properties derives from java.util.Hashtable where jboss-serialization tries to
read the two instanz variables loadFactor and threshold. Threshold is an integer and
loadFactor is a float. It seems that they are swapped. So when reading the loadFactor we
get an Integer value instead of a float value.
It seems that the problem occurs in the Reflection Mechanism of the JDK. The order in
which Properties are returned from a class does not seem to be constant when writting and
reading.
2009-09-30 00:58:39,039 DEBUG [org.jboss.serial.persister.RegularObjectPersister]
FieldName on Read=domains
2009-09-30 00:58:39,039 DEBUG [org.jboss.serial.persister.RegularObjectPersister]
readSlotWithFields slot=at.sozvers.stp.esv.cms.service.config.Configuration
field=domains<<-reading Object
2009-09-30 00:58:39,039 DEBUG [org.jboss.serial.objectmetamodel.ObjectDescriptorFactory]
objectFromDescription::reading new definition
2009-09-30 00:58:39,040 DEBUG [org.jboss.serial.objectmetamodel.ObjectDescriptorFactory]
Reading object for id=3
classLoader=org.jboss.web.tomcat.service.WebCtxLoader$ENCLoader@5ae45ae4 className =
java.util.Properties
2009-09-30 00:58:39,040 DEBUG [org.jboss.serial.persister.RegularObjectPersister]
defaultRead::class java.util.Properties contains 2 slots
2009-09-30 00:58:39,040 DEBUG [org.jboss.serial.persister.RegularObjectPersister]
defaultRead::slot[0]=java.util.Hashtable
2009-09-30 00:58:39,040 DEBUG [org.jboss.serial.persister.RegularObjectPersister]
readSlotWithMethod slot=java.util.Hashtable
2009-09-30 00:58:39,040 DEBUG [org.jboss.serial.persister.RegularObjectPersister]
readSlotWithFields slot=java.util.Hashtable
2009-09-30 00:58:39,040 DEBUG [org.jboss.serial.persister.RegularObjectPersister]
FieldName on Read=loadFactor
java.io.IOException
at
org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(RegularObjectPersister.java:107)
at
org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:269)
at
org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
at
org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
at
org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
at
org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845)
at
org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353)
at
org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:273)
at
org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
at
org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
at
org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
at
org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:845)
at
org.jboss.serial.io.MarshalledObjectForLocalCalls.get(MarshalledObjectForLocalCalls.java:60)
at
org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:96)
at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at
org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:107)
... 227 more
Caused by:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at
org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(RegularObjectPersister.java:103)
... 243 more
Caused by:
org.jboss.serial.exception.SerializationException: Excepted to be float
at
org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readFloat(DataContainer.java:1080)
at
org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:325)
at
org.jboss.serial.persister.ObjectInputStreamProxy.defaultReadObject(ObjectInputStreamProxy.java:78)
at java.util.Hashtable.readObject(Hashtable.java:770)
... 248 more
Caused by:
java.lang.ClassCastException: org.jboss.serial.finalcontainers.IntegerContainer
incompatible with org.jboss.serial.finalcontainers.FloatContainer
at
org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readFloat(DataContainer.java:1076)
... 251 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira