Serialization error when client app on JDK1.6 access WebLogic on JDK1.5

I have a client application running on JDK1.6 and trying to connect to a JMX running on Weblogic 9.2 server with JDK1.5.0_06.

An exception was thrown on client side when processing return from JMX server, the most relevant exception seems to be:

Caused by: java.rmi.UnmarshalException: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser; nested exception is:

java.io.StreamCorruptedException: invalid type code: 31

Could this be an interoperability issues between 1.6 and 1.5 or is it a Weblogic implementation issue?

Thanks,

Danny

--

Full stack trace below:

java.io.IOException

at weblogic.management.remote.common.ClientProviderBase.makeConnection(ClientProviderBase.java:156)

at weblogic.management.remote.common.ClientProviderBase.newJMXConnector(ClientProviderBase.java:79)

at javax.management.remote.JMXConnectorFactory.newJMXConnector(Unknown Source)

at javax.management.remote.JMXConnectorFactory.connect(Unknown Source)

at

...

Caused by: javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser; nested exception is:

java.io.StreamCorruptedException: invalid type code: 31]

at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:74)

at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:32)

at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:773)

at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:673)

at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:466)

at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:373)

at weblogic.jndi.Environment.getContext(Environment.java:307)

at weblogic.jndi.Environment.getContext(Environment.java:277)

at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)

at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)

at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)

at javax.naming.InitialContext.init(Unknown Source)

at javax.naming.InitialContext.<init>(Unknown Source)

at weblogic.management.remote.common.ClientProviderBase.makeConnection(ClientProviderBase.java:143)

... 9 more

Caused by: java.rmi.UnmarshalException: failed to unmarshal class weblogic.security.acl.internal.AuthenticatedUser; nested exception is:

java.io.StreamCorruptedException: invalid type code: 31

at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:225)

at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:224)

at weblogic.common.internal.RMIBootServiceImpl_1001_WLStub.authenticate(Unknown Source)

at weblogic.security.acl.internal.Security$1.run(Security.java:185)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)

at weblogic.security.service.SecurityManager.runAs(Unknown Source)

at weblogic.security.acl.internal.Security.authenticate(Security.java:181)

at weblogic.jndi.WLInitialContextFactoryDelegate.authenticateRemotely(WLInitialContextFactoryDelegate.java:734)

at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:667)

... 19 more

Caused by: java.io.StreamCorruptedException: invalid type code: 31

at java.io.ObjectInputStream.readObject0(Unknown Source)

at java.io.ObjectInputStream.readObject(Unknown Source)

at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:195)

at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:565)

at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:191)

at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)

at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:223)

... 27 more

[4255 byte] By [dannyju@yahooa] at [2007-11-27 10:45:04]
# 1

Found a cause the problem. There was a behavior change in

ClassLoader.loadClass() handling byte array. As discussed in

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6434149

Adding this VM argument to client JVM preserves the backward compatible behavior of loadClass() and provides a workaround without patching JDK or WebLogic server:

-Dsun.lang.ClassLoader.allowArraySyntax=true

dannyju@yahooa at 2007-7-28 20:10:49 > top of Java-index,Core,Core APIs...