Uploaded image for project: 'XMLBeans'
  1. XMLBeans
  2. XMLBEANS-116

SchemaTypeSystemImpl cannot be loaded in many classloaders

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Version 2 Beta 1
    • None
    • None
    • None
    • osx 10.3.8
      java version "1.4.2_05"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.3)
      Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode)

    Description

      at line 141, SchemaTypeSystemImpl has this code:

      public static String METADATA_PACKAGE_GEN = (
      // next line should use String addition to avoid replacement by Repackager: "org." + "apache." + "xmlbeans"
      ("org." + "apache." + "xmlbeans").equals(SchemaTypeSystem.class.getPackage().getName()) ?
      // This is the original org apache xmlbeans package, to maintain backwards compatibility resource pathes must remain the same
      "" :
      // This is the private package XMLBeans, all the metadata will end up in a specific/private resource path
      SchemaTypeSystem.class.getPackage().getName().replaceAll("
      .", "_")
      );

      From the javadoc for Class.getPackage():

      Gets the package for this class. The class loader of this class is used to find the package. If the class was loaded by the bootstrap class loader the set of packages loaded from CLASSPATH is searched to find the package of the class. Null is returned if no package object was created by the class loader of this class.

      Sure enough, I'm getting a NPE trying to load this class due to the package being null. This prevents geronimo moving to v2. Can you do the calculation based on the class name minus ".SchemaTypeSystem"?

      Attachments

        1. SchemaTypeSystemImpl.diff
          1 kB
          David Jencks

        Activity

          People

            Unassigned Unassigned
            djencks David Jencks
            Votes:
            4 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: