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

RMI classloader fails if _Stub.class contains reference to missing RMI interface

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description



      Name: krT82822 Date: 06/29/99


      Ok, here's an odd one for you. I had a situation in which I
      have one RMI server and two clients. For each of the three
      separate executables, I create a separate jar file, containing
      only those files required by the server or client in question.

      In my server, I have an RMI-exported class called GanymedeServer.
      Each of my two clients (primary client and admin console) include
      GanymedeServer_Stub.class in their jar files.

      When I went to run my admin console applet out of its ganymedeAdmin.jar
      file on Win32 with Plug-in 1.2.2, however, the applet failed
      on initialization, complaining that it could not find
      arlut/csd/ganymede/GanymedeServer_Stub.class, despite the fact
      that it was clearly in the jar file.

      What turned out to be the real problem is that one of the remotely-callable
      methods defined in GanymedeServer_Stub.class (login())used an RMI remote
      interface type (Client) as a parameter. The login() method is never
      called by the admin console, which uses a different method (adminLogin())
      for establishing its connection to the server. So, no need for
      the Client.class remote interface class in the admin
      console's jar file, right?

      Nope. The RMI classloader gets confused by the inability to
      find the RMI interface referenced in one of GanymedeServer_Stub's
      remote method signatures, and throws up its hands in protest,
      without explaining clearly what the real problem is, as follows..

      Opening http://csdsun9.arlut.utexas.edu/ganymede/ganymedeAdmin.jar no proxy

      CacheHandler file name: C:\Program Files\Netscape\Users\jonabbey\cache\M1N3T2DM.JAR

      Opening http://csdsun9.arlut.utexas.edu/ganymede/arlut/csd/ganymede/Client.class no proxy

      CacheHandler file name: null

      java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
      java.lang.ClassNotFoundException: arlut.csd.ganymede.GanymedeServer_Stub

      java.lang.ClassNotFoundException: arlut.csd.ganymede.GanymedeServer_Stub

      at java.io.ObjectInputStream.inputObject(Unknown Source)

      at java.io.ObjectInputStream.readObject(Unknown Source)

      at java.io.ObjectInputStream.readObject(Unknown Source)

      at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)

      at java.rmi.Naming.lookup(Unknown Source)

      at arlut.csd.ganymede.GASHAdmin.run(GASHAdmin.java, Compiled Code)

      at java.lang.Thread.run(Unknown Source)

      RMI: RemoteException during lookup.

      My request is either that the missing RMI interface definition
      not be complained about until the RMI method that includes
      that interface in its signature is called, or that at a minimum
      the returned exception accurately describes which file could
      not be loaded.

      Adding the Client.class file to my admin console's jar file
      corrected this problem, but this was extremely confusing and
      caused a number of users some heartache.
      (Review ID: 84556)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              kryansunw Kevin Ryan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: