United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6614558 : jmx interop JDK5 - JDK6 issue when calling getMBeanInfo

Details
Type:
Bug
Submit Date:
2007-10-09
Status:
Resolved
Updated Date:
2011-02-16
Project Name:
JDK
Resolved Date:
2008-12-04
Component:
other-libs
OS:
other,generic,windows
Sub-Component:
corba:idl
CPU:
x86,generic
Priority:
P1
Resolution:
Fixed
Affected Versions:
5.0,6,7
Fixed Versions:
6u12 (b02)

Related Reports
Backport:
Backport:
Backport:
Backport:
Duplicate:
Relates:
Relates:
Relates:

Sub Tasks

Description
First of all, note that this bug is very linked to bug 6614506 :
   jmx interop regression when Server is over JDK6 and Client over JDK5

Indeed, the problem concerns a remote call to getMBeanInfo using rmi/iiop.
The particularity of this test failure compared to bug 6614506 is that :
1) only model MBean is concerned
2) the test fails for all interop configuration, that is :
- server runs on JDK5 and client on JDK6
- server runs on JDK6 and client on JDK5

For these reasons, I prefer to create another bug.
Then close it as duplicated if needed.

The stack trace on client side is :
java.rmi.MarshalException: CORBA MARSHAL 1398079699 Maybe; nested exception is: 
	org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 211 completed: Maybe
	at com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:197)
	at javax.rmi.CORBA.Util.mapSystemException(Util.java:67)
	at org.omg.stub.javax.management.remote.rmi._RMIConnection_Stub.getMBeanInfo(Unknown Source)
	at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.getMBeanInfo(RMIConnector.java:1031)
	at javasoft.sqe.jmx.test.functional.SupportedMBeanInfoTypesTest.run(SupportedMBeanInfoTypesTest.java:168)
	at javasoft.sqe.jmx.share.TestStarter.<init>(TestStarter.java:28)
	at javasoft.sqe.jmx.share.TestStarter.main(TestStarter.java:79)
Caused by: org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 211 completed: Maybe
	at com.sun.corba.se.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:6500)
	at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1045)
	at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
	at com.sun.jmx.remote.internal.PInputStream.read_value(Unknown Source)
	... 5 more
Caused by: java.io.StreamCorruptedException: 
	at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2365)
	at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1560)
	at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:398)
	at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:327)
	at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:293)
	at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
	... 7 more
Caused by: org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 211 completed: Maybe
	at com.sun.corba.se.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:6500)
	at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1045)
	at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
	at com.sun.corba.se.impl.io.ValueHandlerImpl.read_Array(ValueHandlerImpl.java:756)
	at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:325)
	at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:293)
	at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
	at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
	at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1892)
	at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2311)
	... 12 more
Caused by: java.io.StreamCorruptedException: 
	at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2365)
	at com.sun.corba.se.impl.io.IIOPInputStream.defaultReadObjectDelegate(IIOPInputStream.java:570)
	at com.sun.corba.se.impl.io.InputStreamHook.defaultReadObject(InputStreamHook.java:183)
	at javax.management.modelmbean.ModelMBeanAttributeInfo.readObject(ModelMBeanAttributeInfo.java:514)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at com.sun.corba.se.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1694)
	at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectUsingFVD(IIOPInputStream.java:1548)
	at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:398)
	at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:327)
	at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:293)
	at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
	... 20 more
Caused by: org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 211 completed: Maybe
	at com.sun.corba.se.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:6500)
	at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1045)
	at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
	at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1892)
	at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2311)
	... 33 more
Caused by: java.io.StreamCorruptedException: 
	at com.sun.corba.se.impl.io.IIOPInputStream.inputRemoteMembersForReadFields(IIOPInputStream.java:2089)
	at com.sun.corba.se.impl.io.IIOPInputStream.readFields(IIOPInputStream.java:2008)
	at com.sun.corba.se.impl.io.InputStreamHook.readFields(InputStreamHook.java:216)
	at javax.management.modelmbean.DescriptorSupport.readObject(DescriptorSupport.java:1313)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at com.sun.corba.se.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1694)
	at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1212)
	at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400)
	at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:327)
	at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:293)
	at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
	... 36 more
Caused by: org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 211 completed: Maybe
	at com.sun.corba.se.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:6500)
	at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1045)
	at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
	at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1892)
	at com.sun.corba.se.impl.io.IIOPInputStream.inputRemoteMembersForReadFields(IIOPInputStream.java:2070)
	... 49 more
Caused by: java.io.StreamCorruptedException: 
	at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2365)
	at com.sun.corba.se.impl.io.IIOPInputStream.defaultReadObjectDelegate(IIOPInputStream.java:570)
	at com.sun.corba.se.impl.io.InputStreamHook.defaultReadObject(InputStreamHook.java:183)
	at java.util.HashMap.readObject(HashMap.java:1053)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at com.sun.corba.se.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1694)
	at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1212)
	at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400)
	at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:327)
	at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:293)
	at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
	... 52 more
Caused by: org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 211 completed: Maybe
	at com.sun.corba.se.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:6500)
	at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1045)
	at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:253)
	at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1892)
	at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2311)
	... 65 more
Caused by: java.io.InvalidClassException: javax.management.Descriptor; UnsupportedOperationException accessing no-arg constructor
	at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1157)
	at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400)
	at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:327)
	at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:293)
	at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
	... 68 more
Caused by: java.lang.UnsupportedOperationException
	at com.sun.corba.se.impl.io.ObjectStreamClass.newInstance(ObjectStreamClass.java:931)
	at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1143)
	... 72 more
[SQE]  class java.rmi.MarshalException==>CORBA MARSHAL 1398079699 Maybe; nested exception is: 
	org.omg.CORBA.MARSHAL:   vmcid: SUN  minor code: 211 completed: Maybe

                                    

Comments
EVALUATION

###@###.### wrote:
> Hi Ken,
>
> I'm Shanliang from jmx team, I'm studying the bugs and trying to find a workaround in JMX.
>
> I have a question about iiop serialization, I have the following 3 situations:
>
> 1) My class does not implement the method readObject(...)
>
> 2) My class implements the method readObject(...) as:
> private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
>     // do nothing
> }
>
> 3)  My class implements the method readObject(...) as:
> private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
>     in.defaultReadObject();
> }
>
> I found that 1) and 2) got same results, is it as expected?
I'm not sure at this point.
>
> 2) and 3) are different, in fact 3) reproduces the bugs.
Good, that should provide a much simpler test case.  Do you have writeObject
methods defined in cases 2 or 3?
>
>
> If I comment the call in.defaultReadObject() from some JMX classes, the bug disperse.
>
Thanks for the info.  I'll update the corba.evolve test to include the extra cases.

Ken.
                                     
2008-09-11
EVALUATION

Reassigning to the category for RMI/IIOP serialization, since this is clearly not a bug in the JMX code.
                                     
2008-07-22
EVALUATION

The problem may be related to the addition of readObject methods to javax.management.MBeanInfo and .MBeanFeatureInfo with the addition of Descriptors to each.  The method readObject(ObjectInputStream in) starts by doing in.defaultReadObject() and then reads a byte using in.read().  If the object being deserialized comes from JDK 5 then there was no writeObject, which means that in.read() should return -1 for EOF.  And it does do that with RMI/JRMP.  But with RMI/IIOP apparently it gets deeply confused.  You can make the problem go away by testing in.available() > 0 in these methods, and deleting the useless readObject() methods in the various ModelMBean*Info classes.  But you also have to delete ModelMBeanInfoSupport.readObject(), and that method is not useless, so this is not an acceptable fix.
                                     
2007-11-13



Hardware and Software, Engineered to Work Together