Problem connecting JDK1.5 JMX server with JDK1.6 client

I have a JMX client application running on JDK1.6 and trying to connect to a JMX server 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

[4261 byte] By [dannyju@yahooa] at [2007-11-27 10:51:41]
# 1

The first thing you could check is if the class AuthenticatedUser implements java.io.Serializable.

lmalventa at 2007-7-29 11:32:55 > top of Java-index,Core,Monitoring & Management...
# 2

I checked class AuthenticatedUser which does implements java.io.Serializable through interface UserInfo.

// Compiled from AuthenticatedUser.java (version 1.4 : 48.0, super bit)

public class weblogic.security.acl.internal.AuthenticatedUser implements weblogic.security.acl.UserInfo {

// Field descriptor #50 J

private static final long serialVersionUID = 6699361079932480379L;

// Field descriptor #55 Ljava/lang/String;

public static final java.lang.String REALM_NAME = "wl_realm";

// Field descriptor #50 J

private long timeStamp;

// Field descriptor #55 Ljava/lang/String;

private java.lang.String name;

// Field descriptor #59 [B

private byte[] signature;

// Field descriptor #61 B

private byte qos;

// Field descriptor #63 Ljava/net/InetAddress;

private java.net.InetAddress inetAddress;

// Field descriptor #63 Ljava/net/InetAddress;

private java.net.InetAddress localAddress;

// Field descriptor #66 I

private int localPort;

// Field descriptor #68 Ljava/lang/Object;

private transient java.lang.Object sslCertificate;

// Field descriptor #70 Ljava/lang/Class;

static synthetic java.lang.Class class$weblogic$security$acl$internal$AuthenticatedSubject;

// Field descriptor #70 Ljava/lang/Class;

static synthetic java.lang.Class class$weblogic$security$acl$internal$AuthenticatedUser;

...

dannyju@yahooa at 2007-7-29 11:32:55 > top of Java-index,Core,Monitoring & Management...
# 3

Did you try posting your message to the BEA forums?

Have a look at this thread:

http://forums.bea.com/bea/message.jspa?messageID=400009567&tstart=0

Maybe it has something to do with the

-Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0

system property.

lmalventa at 2007-7-29 11:32:55 > top of Java-index,Core,Monitoring & Management...
# 4

I did try -Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0

but it didn't work.

From the BEA forum thread, it wasn't the solution either.

Thanks for the msg anyway.

dannyju@yahooa at 2007-7-29 11:32:55 > top of Java-index,Core,Monitoring & Management...
# 5

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-29 11:32:55 > top of Java-index,Core,Monitoring & Management...