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

java.rmi.server.codebase can not be dynamically assigned

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0, 1.4.0
    • core-libs
    • generic, sparc
    • generic, solaris_7



      Name: yyT116575 Date: 02/21/2001


      java version "1.3.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_01)
      Java HotSpot(TM) Client VM (build 1.3.0_01, mixed mode)

      Alternate summary: java.rmi.server.codebase must be assigned before first use of
      RMI machinery

      The RMI specifications states that the "java.rmi.server.codebase" system
      property is used to annotate classes from a server JVM.
      However, I experienced that this property must be defined the first time the RMI
      system is used. If ever some code in the same JVM already looked up an object
      into an RMI registry and at that time no "java.rmi.server.codebase" system
      property was defined, then all subsequent uses of the RMI subsystem will work
      with the same initial null value of the "java.rmi.server.codebase" system
      property and ignore any value assigned after the first call.


      Looking at the provided JDK sources, I think this comes from the fact that
      java.rmi.server.RMIClassLoader.getClassAnnotation(Class cl) makes a static call
      to sun.rmi.server.LoaderHandler.getClassAnnotation(cl) and that this class may
      cache for performance reasons a copy of the "java.rmi.server.codebase" system
      property value that is initialized once.

      The net result is that it is difficult to ship a Java library that will coexist
      with other code in the same JVM, and have that library dynamically define the
      "java.rmi.server.codebase" system property.
      It would be desirable to fix this problem by either removing the optimization
      made, or by providing a way to dynamically force the refresh/assignment of the
      current codebase.

      I hope that at least this report can save time to some developers wondering why
      they dynamic assignement of the "java.rmi.server.codebase" system property is
      ignored.
      (Review ID: 117382)
      ======================================================================

            ldorninsunw Laird Dornin (Inactive)
            yyoungsunw Yung-ching Young (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: