Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6619366

javax.management.remote.rmi.RMIConnector.getConnection code relies on non-compliant behaviour of ORB

    Details

    • Subcomponent:
    • Resolved In Build:
      b07
    • CPU:
      other
    • OS:
      solaris_9

      Backports

        Description

        OPERATING SYSTEM(S):
        SunOS 5.10

        FULL JDK VERSION(S):
        java version "1.6.0_03-ea"
        Java(TM) 2 Runtime Environment, Standard Edition (IBM build 1.6.0_03-ea-b02 03_Oct_2007_05_32)
        Java HotSpot(TM) Server VM (build 1.6.0_03-ea-b02, mixed mode)

        DESCRIPTION:

        The javax.management.remote.rmi.RMIConnector.getConnection code relies on non-compliant behaviour of the ORB which causes JCK failures in the IBM Hybrid builds.

        Failing testcases:

        api/javax_management/remote/loading/index.html#RmiIiopClientDefaultClassLoaderTest[JMXConnectorFactory0002]
        api/javax_management/remote/loading/index.html#RmiIiopClientDefaultClassLoaderTest[JMXConnectorFactory0003]
        api/javax_management/remote/loading/index.html#RmiIiopClientDefaultClassLoaderTest[JMXConnectorFactory0004]
        api/javax_management/remote/loading/index.html#RmiIiopClientDefaultClassLoaderTest[JMXConnectorFactory0005]
        api/javax_management/remote/loading/index.html#RmiIiopClientDefaultClassLoaderTest[JMXConnectorFactory0006]
        api/javax_management/remote/security/index.html#RmiIiopMBeanServerForwarderTest
        api/javax_management/remote/JMXConnector/index.html#IIOPConnectorTest[ConnectorConnect009]
        api/javax_management/remote/security/index.html#RmiIiopMBeanServerConnectionTest[getMBeanInfo0001]
        api/javax_management/remote/loading/index.html#RmiIiopServerDefaultClassLoaderTest[JMXConnectorServerFactory0004]
        api/javax_management/remote/loading/index.html#RmiIiopServerDefaultClassLoaderTest[JMXConnectorServerFactory0005]
        api/javax_management/remote/loading/index.html#RmiIiopServerDefaultClassLoaderTest[JMXConnectorServerFactory0006]
        api/javax_management/remote/loading/index.html#RmiIiopServerDefaultClassLoaderTest[JMXConnectorServerFactory0007]
        api/javax_management/remote/security/index.html#RmiIiopSubjectDelegationTest[SubjectDelegationTest0004]
        api/javax_management/remote/security/index.html#RmiIiopSubjectDelegationTest[SubjectDelegationTest0005]
        api/javax_management/remote/security/index.html#RmiIiopSubjectDelegationTest[SubjectDelegationTest0007]
        api/javax_management/remote/security/index.html#RmiIiopSubjectDelegationTest[SubjectDelegationTest0008]
        api/javax_management/remote/security/index.html#RmiIiopSubjectDelegationTest[SubjectDelegationTest0009]
        api/javax_management/remote/rmi/RMIConnection/index.html#RMIConnectionTest[RMIConnectionTest0003]

        In the test case, a JMXConnectorServer, say server is created by calling JMXConnectorServerFactory.newJMXConnectorServer(). A Connection Stub client is created by calling server.toJMXConnector(). Then there is a call to client.connect().

        The connector stub is a JMXConnector, but since this is a remote case, the connector stub is of type RMIConnector (implementing the JMXConnector interface).

        Through the connect() method, the IBM ORB looks up for the javax.management.remote.rmi._RMIConnection_Stub class.

        The stubClass loaded by the IBM ORB is of type

            javax.management.remote.rmi._RMIConnection_Stub

        but the RMIConnector.getConnection code is expecting a

            org.omg.stub.javax.management.remote.rmi._RMIConnection_Stub.

        Therefore the comparison

            if (c.getClass().getName().equals(iiopConnectionStubClassName))

        fails and shadowIiopStub is not called. Subsequently, the test fails with several failures.

        The lookup for the javax.management.remote.rmi._RMIConnection_Stub is compliant with the Java2IDL specification. As per section 1.4.6 of the Java 2 IDL specification, the ORB should use the following logic to decide which stub class to load:

         "When loading a stub class corresponding to an interface or class
        <packagename>.<typename>, the class <packagename>._<typename>_Stub shall be used if it exists; otherwise, the class org.omg.stub.<packagename>._<typename>_Stub shall be used."

        SUN has provided both versions of the _RMIConnection_Stub class in rt.jar. The stubClass loaded by the Sun ORB is of type org.omg.stub.javax.management.remote.rmi._RMIConnection_Stub and not javax.management.remote.rmi._RMIConnection_Stub. This is not compliant as per the java2IDL spec, so the behaviour of the Sun ORB is incorrect.

        The IBM ORB loads the javax.management.remote.rmi._RMIConnection_Stub in a spec compliant manner, resulting in the failures.

        Note that in a similar manner Sun also ships two versions of the _RMIServer_Stub class. This has not us caused any problems so far, but we feel it is worth a mention in case it could cause similar problems in the future.

        The jtr failure reports have been provided to Dave Korbel.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  emcmanus Eamonn McManus
                  Reporter:
                  elarsen Erik Larsen (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: