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

<rmic -idl> or <rmic -iiop> fails in JDK1.3/1.3.1 with class loading

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.3.0
    • other-libs
    • beta2
    • x86
    • linux
    • Not verified



        Name: boT120536 Date: 04/04/2001


        java version "1.3.1-beta"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-beta-b15)
        Java HotSpot(TM) Client VM (build 1.3.1beta-b15, mixed mode)


        Used Java version:
        ------------------
         JDK: java version "1.3.1-beta"
              Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-beta-b15)
              Java HotSpot(TM) Client VM (build 1.3.1beta-b15, mixed mode)

        Used Packages:
        --------------
         JINI: Jini 1.1 contains following jars a.o.:

            26514 Okt 10 18:04 jini-core.jar
           139528 Okt 10 18:04 jini-ext.jar

        CLASSPATH:
        ----------
        .:/usr/local/java/jdks/noarch/jini1_1/lib/jini-core.jar:/usr/local/java/jdks/noarch/jini1_1/lib/jini-ext.jar

        Reproduction:
        -------------

        Create the classes A, B and C:

        A.java:
        -------
         import java.rmi.Remote;
         import java.rmi.RemoteException;

         public interface A
                extends Remote
         {
           public C foo() throws RemoteException;
         }

        B.java:
        -------
         package test;

         import java.rmi.Remote;
         import java.rmi.RemoteException;
         import javax.rmi.PortableRemoteObject;

         import java.util.ResourceBundle;

         public class B
                extends PortableRemoteObject
                implements A
         {
           public B() throws RemoteException
          {
          C c = new C();
        System.err.println(c);

        ResourceBundle bundle = ResourceBundle.getBundle("B");
        System.err.println(bundle.getString("key"));
        }

           public C foo()
        {
        return new C();
        }

           public static void main(String[] args) throws RemoteException
        {
        B b = new B();
        System.err.println(b);
        }
         }


        C.java:
        -------
         import net.jini.entry.AbstractEntry;

         public class C
                extends AbstractEntry
         {
           public C()
          [{
          }
         }

        Compile all class files:

        > javac A.java B.java C.java

        You'll get following class files:

         181 Apr 4 09:51 A.class
         563 Apr 4 09:51 B.class
         192 Apr 4 09:51 C.class

        -> Run the RMI compiler

        rmic B

        Thsi works fine and creates following files:

           1362 Apr 4 09:53 B_Skel.class
           2776 Apr 4 09:53 B_Stub.class

        The rmic bug occurs when using the "-idl" option to create IDL files:

        > rmic -idl B

        Following output is printed:
        java.lang.ClassFormatError: net/jini/entry/AbstractEntry (Illegal constant pool
        type)
                at java.lang.ClassLoader.defineClass0(Native Method)
                at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
                at java.lang.ClassLoader.defineClass(ClassLoader.java:426)
                at sun.rmi.rmic.iiop.ClassPathLoader.findClass(ClassPathLoader.java:34)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
                at sun.rmi.rmic.iiop.CompoundType.loadClass(CompoundType.java:314)
                at sun.rmi.rmic.iiop.Type.initClass(Type.java:964)
                at sun.rmi.rmic.iiop.Type.setRepositoryID(Type.java:981)
                at sun.rmi.rmic.iiop.CompoundType.initialize(CompoundType.java:755)
                at sun.rmi.rmic.iiop.ValueType.initialize(ValueType.java:251)
                at sun.rmi.rmic.iiop.ValueType.forValue(ValueType.java:111)
                at sun.rmi.rmic.iiop.CompoundType.makeType(CompoundType.java:902)
                at sun.rmi.rmic.iiop.ClassType.initParents(ClassType.java:191)
                at sun.rmi.rmic.iiop.ValueType.initialize(ValueType.java:222)
                at sun.rmi.rmic.iiop.ValueType.forValue(ValueType.java:111)
                at sun.rmi.rmic.iiop.CompoundType.makeType(CompoundType.java:902)
                at sun.rmi.rmic.iiop.CompoundType$Method.<init>(CompoundType.java:2234)
                at sun.rmi.rmic.iiop.CompoundType.addAllMethods(CompoundType.java:1301)
                at
        sun.rmi.rmic.iiop.RemoteType.isConformingRemoteInterface(RemoteType.java:216)
                at sun.rmi.rmic.iiop.RemoteType.initialize(RemoteType.java:165)
                at sun.rmi.rmic.iiop.RemoteType.forRemote(RemoteType.java:84)
                at
        sun.rmi.rmic.iiop.CompoundType.addRemoteInterfaces(CompoundType.java:1370)
                at
        sun.rmi.rmic.iiop.ImplementationType.initialize(ImplementationType.java:160)
                at
        sun.rmi.rmic.iiop.ImplementationType.forImplementation(ImplementationType.java:86)
                at sun.rmi.rmic.iiop.CompoundType.makeType(CompoundType.java:885)
                at sun.rmi.rmic.iiop.CompoundType.forCompound(CompoundType.java:243)
                at sun.rmi.rmic.iiop.IDLGenerator.getTopType(IDLGenerator.java:88)
                at sun.rmi.rmic.iiop.Generator.generate(Generator.java:262)
                at sun.rmi.rmic.Main.doCompile(Main.java:526)
                at sun.rmi.rmic.Main.compile(Main.java:133)
                at sun.rmi.rmic.Main.main(Main.java:761)
        error: An error has occurred in the compiler; please file a bug report
        (http://java.sun.com/cgi-bin/bugreport.cgi).
        1 error

        The call

        > rmic -ioop B

        outputs the very same error message.


        JDK 1.3.0
        ---------

        java version "1.3.0"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
        Classic VM (build 1.3.0, green threads, nojit)

        Using JDK 1.3.0 procudes (a different) following error:

          error: Could not load class net.jini.core.entry.Entry.
          error: Class A contains an invalid return type.
        2 errors
        (Review ID: 120105)
        ======================================================================

              eandersosunw Everett Anderson (Inactive)
              bonealsunw Bret O'neal (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: