remm        2003/08/26 01:31:00

  Modified:    catalina/src/share/org/apache/catalina/ant
                        ValidatorTask.java
  Log:
  - I was suddenly getting some java.lang.ExceptionInInitializerError when running
   the task after JSPC (running it without JSPC worked ok), related with 
commons-logging
   (as usual). I'm not sure how real this bug is (diffing revealed the code didn't 
change at
   al), but setting the context classloader makes c-l happy.
  
  Revision  Changes    Path
  1.2       +11 -4     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/ValidatorTask.java
  
  Index: ValidatorTask.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/ant/ValidatorTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ValidatorTask.java        14 May 2003 17:45:36 -0000      1.1
  +++ ValidatorTask.java        26 Aug 2003 08:31:00 -0000      1.2
  @@ -132,6 +132,11 @@
               throw new BuildException("Cannot find web.xml");
           }
   
  +        // Commons-logging likes having the context classloader set
  +        ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
  +        Thread.currentThread().setContextClassLoader
  +            (ValidatorTask.class.getClassLoader());
  +
           Digester digester = ContextConfig.createWebXmlDigester(true, true);
           try {
               file = file.getCanonicalFile();
  @@ -142,6 +147,8 @@
               digester.parse(is);
           } catch (Throwable t) {
               throw new BuildException("Validation failure", t);
  +        } finally {
  +            Thread.currentThread().setContextClassLoader(oldCL);
           }
   
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to