Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 7 Migration - New JBoss Serialization-related exception

I'm trying to upgrade an application to Java 7 from Java 6 and I'm getting a new exception that isn't present when running the application under Java 6.

Here's the first section of the stack trace:

java.lang.ClassCastException: java.lang.String cannot be cast to org.jboss.serial.finalcontainers.IntegerContainer
    at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readInt(DataContainer.java:1044)
    at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:310)
    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.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:353)
    at org.jboss.serial.persister.RegulrObjectPersister.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.persister.ObjectInputStreamProxy.readObjectOverride(ObjectInputStreamProxy.java:68)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:364)
    at java.util.ArrayList.readObject(ArrayList.java:733)
    at sun.reflect.GeneratedMethodAccessor352.invoke(Unknown Source)

I found this JBoss bug, which is supposedly fixed... https://issues.jboss.org/browse/JBSER-128

but the version it's fixed in (1.0.6.FINAL) hasn't been released yet: https://issues.jboss.org/browse/JBSER

Has anybody run into this that could suggest a workaround?

The application runs in JBoss 6.0.0.

PS I am aware that JBoss 6 is past its EOL and not tested with Java 7.

like image 346
StormeHawke Avatar asked Dec 03 '25 05:12

StormeHawke


1 Answers

I found a workaround solution for my problem. Since Java 7 changed the serialization behavior of Vector, I changed to ArrayList (which did not change) and the problem has been resolved.

Hope this helps somebody out there struggling with the same issue.

like image 119
StormeHawke Avatar answered Dec 06 '25 03:12

StormeHawke



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!