You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "David Jencks (JIRA)" <xm...@xml.apache.org> on 2005/03/03 02:10:51 UTC

[jira] Created: (XMLBEANS-116) SchemaTypeSystemImpl cannot be loaded in many classloaders

SchemaTypeSystemImpl cannot be loaded in many classloaders
----------------------------------------------------------

         Key: XMLBEANS-116
         URL: http://issues.apache.org/jira/browse/XMLBEANS-116
     Project: XMLBeans
        Type: Bug
    Versions: Version 2 Beta 1    
 Environment: 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)
    Reporter: David Jencks


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"?



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Resolved: (XMLBEANS-116) SchemaTypeSystemImpl cannot be loaded in many classloaders

Posted by "Cezar Andrei (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-116?page=history ]
     
Cezar Andrei resolved XMLBEANS-116:
-----------------------------------

    Resolution: Fixed

Fixed, thanks David Jencks for the patch.

> SchemaTypeSystemImpl cannot be loaded in many classloaders
> ----------------------------------------------------------
>
>          Key: XMLBEANS-116
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-116
>      Project: XMLBeans
>         Type: Bug
>     Versions: Version 2 Beta 1
>  Environment: 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)
>     Reporter: David Jencks
>     Assignee: Cezar Andrei
>  Attachments: SchemaTypeSystemImpl.diff
>
> 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"?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-116) SchemaTypeSystemImpl cannot be loaded in many classloaders

Posted by "David Jencks (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-116?page=comments#action_60142 ]
     
David Jencks commented on XMLBEANS-116:
---------------------------------------

This small patch fixes the issue for me and appears to produce the expected result for the "private" case, but I have no way to test the "private" case in detail.

Index: src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java
===================================================================
--- src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java      (revision 155878)
+++ src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java      (working copy)
@@ -149,14 +149,13 @@
      */
     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())     ?
+        ("org." + "apache." + "xmlbeans." + "SchemaTypeSystem").equals(SchemaTypeSystem.class.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("\\.", "_")
+        SchemaTypeSystem.class.getName().substring(0, SchemaTypeSystem.class.getName().lastIndexOf(".")).replaceAll("\\.", "_")
         );
 


> SchemaTypeSystemImpl cannot be loaded in many classloaders
> ----------------------------------------------------------
>
>          Key: XMLBEANS-116
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-116
>      Project: XMLBeans
>         Type: Bug
>     Versions: Version 2 Beta 1
>  Environment: 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)
>     Reporter: David Jencks
>     Assignee: Cezar Andrei

>
> 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"?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Assigned: (XMLBEANS-116) SchemaTypeSystemImpl cannot be loaded in many classloaders

Posted by "Kevin Krouse (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-116?page=history ]

Kevin Krouse reassigned XMLBEANS-116:
-------------------------------------

    Assign To: Cezar Andrei

> SchemaTypeSystemImpl cannot be loaded in many classloaders
> ----------------------------------------------------------
>
>          Key: XMLBEANS-116
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-116
>      Project: XMLBeans
>         Type: Bug
>     Versions: Version 2 Beta 1
>  Environment: 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)
>     Reporter: David Jencks
>     Assignee: Cezar Andrei

>
> 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"?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Updated: (XMLBEANS-116) SchemaTypeSystemImpl cannot be loaded in many classloaders

Posted by "David Jencks (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-116?page=history ]

David Jencks updated XMLBEANS-116:
----------------------------------

    Attachment: SchemaTypeSystemImpl.diff

patch as a file

> SchemaTypeSystemImpl cannot be loaded in many classloaders
> ----------------------------------------------------------
>
>          Key: XMLBEANS-116
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-116
>      Project: XMLBeans
>         Type: Bug
>     Versions: Version 2 Beta 1
>  Environment: 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)
>     Reporter: David Jencks
>     Assignee: Cezar Andrei
>  Attachments: SchemaTypeSystemImpl.diff
>
> 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"?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Commented: (XMLBEANS-116) SchemaTypeSystemImpl cannot be loaded in many classloaders

Posted by "Graham Leggett (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-116?page=comments#action_60733 ]
     
Graham Leggett commented on XMLBEANS-116:
-----------------------------------------

Getting the same problem under the following environment:

RHEL3
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)


> SchemaTypeSystemImpl cannot be loaded in many classloaders
> ----------------------------------------------------------
>
>          Key: XMLBEANS-116
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-116
>      Project: XMLBeans
>         Type: Bug
>     Versions: Version 2 Beta 1
>  Environment: 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)
>     Reporter: David Jencks
>     Assignee: Cezar Andrei

>
> 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"?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[jira] Closed: (XMLBEANS-116) SchemaTypeSystemImpl cannot be loaded in many classloaders

Posted by "Jacob Danner (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-116?page=all ]
     
Jacob Danner closed XMLBEANS-116:
---------------------------------

    Assign To:     (was: Cezar Andrei)

Fixed, please create a new issue is something similar arises

> SchemaTypeSystemImpl cannot be loaded in many classloaders
> ----------------------------------------------------------
>
>          Key: XMLBEANS-116
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-116
>      Project: XMLBeans
>         Type: Bug
>     Versions: Version 2 Beta 1
>  Environment: 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)
>     Reporter: David Jencks
>  Attachments: SchemaTypeSystemImpl.diff
>
> 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"?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org