当前位置: 代码迷 >> J2EE >> 监控weblogic出错,该如何解决
  详细解决方案

监控weblogic出错,该如何解决

热度:70   发布时间:2016-04-22 01:42:46.0
监控weblogic出错
至今为止只添加了一个weblogic.jar包
Exception in thread "main" java.io.IOException
at weblogic.management.remote.common.ClientProviderBase.makeConnection(ClientProviderBase.java:135)
at weblogic.management.remote.common.ClientProviderBase.newJMXConnector(ClientProviderBase.java:79)
at javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:338)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:247)
at org.huabo.monitorMain.MonitorWeblogic.initConnection(MonitorWeblogic.java:168)
at org.huabo.monitorMain.MonitorWeblogic.main(MonitorWeblogic.java:149)
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:85)
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:41)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:765)
at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:665)
at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:465)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:372)
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(NamingManager.java:667)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.init(InitialContext.java:223)
at javax.naming.InitialContext.<init>(InitialContext.java:197)
at weblogic.management.remote.common.ClientProviderBase.makeConnection(ClientProviderBase.java:125)
... 5 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:203)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:224)
at weblogic.common.internal.RMIBootServiceImpl_920_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(SecurityManager.java:147)
at weblogic.security.acl.internal.Security.authenticate(Security.java:181)
at weblogic.jndi.WLInitialContextFactoryDelegate.authenticateRemotely(WLInitialContextFactoryDelegate.java:726)
at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:659)
... 15 more
Caused by: java.io.StreamCorruptedException: invalid type code: 31
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
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:201)
... 23 more

------解决方案--------------------
有人碰到过已经解决了:
http://blog.csdn.net/gaohaiyang/article/details/6125416

导致这个问题的根本原因就是虚拟机的参数sun.lang.ClassLoader.allowArraySyntax,如上所述在jdk1.5中,这个参数默认值是true,而在jdk1.6中这个参数的默认值是false。
  相关解决方案