TomcatFileNotFoundException

HomePage | RecentChanges | Preferences

Problem

Webapps that work fine on Windows fail on HP-UX with this in the webapp log file:

14:23:17,696 - DEBUG org.apache.struts.action.ActionServlet - Initializing module path '' plug ins                                                              
14:23:17,725 - INFO org.apache.struts.validator.ValidatorPlugIn - Loading validation rules file from '/WEB-INF/validator-rules.xml'                             
14:23:17,726 - INFO org.apache.struts.validator.ValidatorPlugIn - Loading validation rules file from '/WEB-INF/validation.xml'                                  
14:23:17,864 - ERROR org.apache.struts.validator.ValidatorPlugIn - JAR entry org/apache/commons/validator/resources/validator_1_1_3.dtd not found in opt/hpws/tomcat/webapps/bentest/WEB-INF/lib/commons-validator.jar                         
java.io.FileNotFoundException: JAR entry org/apache/commons/validator/resources/validator_1_1_3.dtd not found in /opt/hpws/tomcat/webapps/bentest/WEB-INF/lib/commons-validator.jar                                                             
        at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:97)                                                                          
        at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:107)                                                                  
        at java.net.URL.openStream(URL.java:913)                                
        at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)                                                                           
        at org.apache.xerces.impl.XMLEntityManager.startEntity(Unknown Source)  
        at org.apache.xerces.impl.XMLEntityManager.startDTDEntity(Unknown Source)                                                                               
        at org.apache.xerces.impl.XMLDTDScannerImpl.setInputSource(Unknown Source)                                                                              
        at org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknown Source)                                                                 
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)                                                                   
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)   
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)     
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)            
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)    
        at org.apache.commons.digester.Digester.parse(Digester.java:1591)       
        at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:159)                                                                  
        at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:237)                                                                  
        at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)                                                                           
        at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)                                                                     
        at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)  
        at javax.servlet.GenericServlet.init(GenericServlet.java:256)           
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)                                                                       
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)                                                                              
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3427)                                                                    
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:3628)                                                                            
        at org.apache.catalina.startup.HostConfig.checkWebXmlLastModified(HostConfig.java:614)                                                                  
        at org.apache.catalina.startup.HostConfig.run(HostConfig.java:854)      
        at java.lang.Thread.run(Thread.java:534)                                

The relevant error message is: "JAR entry org/apache/commons/validator/resources/validator_1_1_3.dtd not found in opt/hpws/tomcat/webapps/bentest/WEB-INF/lib/commons-validator.jar"

For some unknown reason, the HP-UX JVM is unable to read that file out of the .jar.

Solution

The solution is to extract the offending file and put it in the proper directory structure under WEB-INF/classes. Things in 'classes' override things in 'lib' so the file is found in 'classes' first and things work again.

In build.xml before building the .war file:

      <!-- fix for HP-UX's inability to find this file in the .jar -->
      <unjar src="${lib}/commons-validator.jar"
            dest="${webinf}/classes">
         <patternset>
            <include name="**/validator_1_1_3.dtd"/>
         </patternset>
      </unjar>

HomePage | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited April 7, 2005 4:56 pm by wsmoak.vpia.asu.edu (diff)
Search: