Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-88

[configuration] ClassNotFoundException on Sun App Server

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • None
    • Operating System: Windows XP
      Platform: PC

    • 33475

    Description

      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
      {

      Attachments

        Activity

          People

            Unassigned Unassigned
            mbcolbert@yahoo.com Mike Colbert
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: