You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/02/09 22:36:05 UTC

DO NOT REPLY [Bug 33475] New: - [configuration] [PATCH] ClassNotFoundException on Sun App Server

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33475>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33475

           Summary: [configuration] [PATCH] ClassNotFoundException on Sun
                    App Server
           Product: Commons
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Configuration
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: mbcolbert@yahoo.com


When used in an EJB application deployed on Sun app server 8.1 (platform edition
8.1 build b28-beta), ConfigurationFactory throws a java.lang.ClassNotFoundException:
org.apache.commons.configuration.Configuration.

Sun includes Digester in at least one of the jars included with the platform,
appserv-rt.jar, so presumably Digester is being loaded by the System
classloader.  This makes Digester unable to find classes loaded by the EJB
classloader (in this case, classes in configuration-1.0.jar) unless Digester's
useContextClassLoader variable is set to true.

This patch modifies ConfigurationFactory to set useContextClassLoader to true on
the digester.

Index: ConfigurationFactory.java
===================================================================
RCS file:
/home/cvspublic/jakarta-commons/configuration/src/java/org/apache/commons/configuration/ConfigurationFactory.java,v
retrieving revision 1.20
diff -u -w -b -r1.20 ConfigurationFactory.java
--- ConfigurationFactory.java	23 Dec 2004 18:42:25 -0000	1.20
+++ ConfigurationFactory.java	9 Feb 2005 20:22:18 -0000
@@ -152,8 +152,12 @@
             // awareness must be configured before the digester rules are
loaded.
             configureNamespace(digester);
         }
+
+        digester.setUseContextClassLoader (true);
+
         // Put the composite builder object below all of the other objects.
         digester.push(builder);
+
         // Parse the input stream to configure our mappings
         try
         {

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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