[ https://issues.apache.org/jira/browse/DIRMINA-930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14122869#comment-14122869 ]
Emmanuel Lecharny commented on DIRMINA-930: ------------------------------------------- It's quite clear : serializing an instance using Java 6 won't be deserialized by a Java 7 server (and it fails both ways). Here, I would suggest not to use the ObjectSerializationCodecFactory which is clearly Java version dependent, but instead write your own encoder/decoder. For MINA 3.0, we have to implement an Java independent serialization mechanism. > Problems with ObjectSerializationCodecFactory using MINA in between Java 6 > and Java 7 > ------------------------------------------------------------------------------------- > > Key: DIRMINA-930 > URL: https://issues.apache.org/jira/browse/DIRMINA-930 > Project: MINA > Issue Type: Bug > Components: Core > Affects Versions: 2.0.7 > Environment: Windows 7, Java 7, Java 6 > Reporter: Marco Waimer > Priority: Critical > Fix For: 3.0.0-trunk > > Attachments: MinaClient.java, MinaServer.java, Server6Client7.txt, > Server7Client6.txt > > > We use mina with the > org.apache.mina.filter.codec.serialization.ObjectSerializationCodecFactory > for our communication framework. Using Java 7 on one side (i.e. server) and > Java 6 on the other side (i.e. client) leads to problems with the > deserialisation, in our case with a java.util.Locale object, which has > additional fields in Java 7. See attached stack traces. > We tracked the problem to > org.apache.mina.core.buffer.AbstractIoBuffer.putObject(Object) and > org.apache.mina.core.buffer.AbstractIoBuffer.getObject(ClassLoader), since > this part is overriding java serialisation and omitting some class > information, which will be needed for the deserialisation. > Using the attached example the stack traces could easily be reproduced, > running one part with Java 7 and the other with Java 6. The MinaServer will > simply open a port and the MinaClient will send a java.util.Locale object to > that port. > In MINA 1.1.7 ObjectOutputStream and ObjectInputStream were used without > overriding writeClassDescriptor/readClassDescriptor, therefore the problem > does not exist there. -- This message was sent by Atlassian JIRA (v6.3.4#6332)