You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mark Woon <mo...@SMI.Stanford.EDU> on 2002/12/04 12:16:31 UTC

Problem going from 4.0.6 to 4.1.16b

Hi All.

I'm hoping someone can shed some light on my problem.  I'm trying to 
upgrade from 4.0.6 to 4.1.16b and I'm finding that I'm unable to access 
any JAR's in WEB-INF/lib.  Here's what I'm getting from localhost_log:

2002-12-04 03:09:17 StandardContext[]: Starting
2002-12-04 03:09:17 StandardContext[]: Processing start(), current 
available=false
2002-12-04 03:09:17 StandardContext[]: Configuring default Resources
2002-12-04 03:09:17 StandardContext[]: Configuring non-privileged 
default Loader
2002-12-04 03:09:17 StandardContext[]: Configuring default Manager
2002-12-04 03:09:17 StandardContext[]: Processing standard container startup
2002-12-04 03:09:17 WebappLoader[]: Deploying class repositories to work 
directory 
D:\Morpheus\Dev\PharmGen\runtime\tomcat\work\Standalone\localhost\_
2002-12-04 03:09:17 WebappLoader[]: Deploy class files /WEB-INF/classes 
to d:\Morpheus\Dev\PharmGen\www\WEB-INF\classes
2002-12-04 03:09:17 WebappLoader[]: Deploy JAR /WEB-INF/lib/xalan.jar to 
d:\Morpheus\Dev\PharmGen\www\WEB-INF\lib\xalan.jar
2002-12-04 03:09:17 WebappLoader[]: Deploy JAR 
/WEB-INF/lib/xercesImpl.jar to 
d:\Morpheus\Dev\PharmGen\www\WEB-INF\lib\xercesImpl.jar
2002-12-04 03:09:17 WebappLoader[]: Deploy JAR 
/WEB-INF/lib/xmlParserAPIs.jar to 
d:\Morpheus\Dev\PharmGen\www\WEB-INF\lib\xmlParserAPIs.jar
2002-12-04 03:09:17 WebappLoader[]: Reloading checks are enabled for 
this Context
2002-12-04 03:09:17 ContextConfig[]: ContextConfig: Processing START
2002-12-04 03:09:17 StandardContext[]: Setting deployment descriptor 
public ID to '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN'
2002-12-04 03:09:18 StandardContext[]: Setting deployment descriptor 
public ID to '-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN'
2002-12-04 03:09:18 ContextConfig[]:  Accumulating TLD resource paths
2002-12-04 03:09:18 ContextConfig[]:   Scanning <taglib> elements in web.xml
2002-12-04 03:09:18 ContextConfig[]:   Scanning TLDs in /WEB-INF 
subdirectory
2002-12-04 03:09:18 ContextConfig[]:   Scanning JARs in /WEB-INF/lib 
subdirectory
2002-12-04 03:09:18 ContextConfig[]:  Scanning JAR at resource path 
'/WEB-INF/lib/xmlParserAPIs.jar'
2002-12-04 03:09:18 ContextConfig[] Exception processing JAR at resource 
path /WEB-INF/lib/xmlParserAPIs.jar
javax.servlet.ServletException: Exception processing JAR at resource 
path /WEB-INF/lib/xmlParserAPIs.jar
    at 
org.apache.catalina.startup.ContextConfig.tldScanJar(ContextConfig.java:930)
    at 
org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:868)
    at 
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:647)
    at 
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:243)
    at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
    at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:3567)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
    at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
    at 
org.apache.catalina.core.StandardService.start(StandardService.java:497)
    at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
----- Root Cause -----
java.io.IOException: The system cannot find the path specified
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    at java.io.File.checkAndCreate(File.java:1313)
    at java.io.File.createTempFile(File.java:1401)
    at java.io.File.createTempFile(File.java:1438)
    at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:169)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:164)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:42)
    at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:78)
    at 
sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:85)
    at 
sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:69)
    at 
org.apache.catalina.startup.ContextConfig.tldScanJar(ContextConfig.java:906)
    at 
org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:868)
    at 
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:647)
    at 
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:243)
    at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
    at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:3567)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
    at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
    at 
org.apache.catalina.core.StandardService.start(StandardService.java:497)
    at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
    at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
    at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)


I'm running Tomcat 4.1.16b on WinXP with JDK 1.4.1.  I've attached a 
copy of my server.xml file.  My app works fine under Tomcat 4.0.6. 
Does anyone have any ideas?  Am I doing something wrong, or is there a 
bug in Tomcat?

Thanks,
-Mark




Re: Problem going from 4.0.6 to 4.1.16b

Posted by Jacob Kjome <ho...@visi.com>.
Remove all XML/DOM libraries from WEB-INF/lib.  They belong in a parent 
classloader.  This includes xalan.jar, xercesImpl.jar, and 
xmlParserAPIs.jar.  It violates the Sun classloading spec to load the XML 
parser and W3C DOM libraries from a child classloader.  They belong in 
common/endorsed or common/lib.

See....

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6374

<quote name="Remy Maucherat">
Yes, I know it doesn't happen with b2. There were other more insidious problems
with using a XML parser in a webapp repository (see 6248, and many messages on
tomcat-user).
It will force the XML base classes (and their subpackages, unfortunately, 
that's
where the bug is) to be loaded from one of the parent shared classloader.

I've put a fix already in CVS in both branches (the base XML classes won't be
loaded to avoid the classcasts, but all the subpackages will). It is not
possible, and is actually forbidden by the servlet spec, to load those classes
from the webapp repositories.

LATER means that I'd like to implement a better mechanism to fully 
implement the
spec requirements (although it will need some special configuration by the user
to define which libraries it has installed). This probably will stay in the 
HEAD
branch, so the resolution of the bug may not be the right one.
</quote>

I additon, this has some good explanation:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7175

<quote name="Patrick Luby">
I agree with Remy that you should stop trying to override the default XML 
parser.
While you *may* be able to override it when using JDK 1.3, you will absolutely
not be able to do it with JDK 1.4 as JDK 1.4 treats the XML parsing classes 
(also
known as "endorsed" classes) as system classes. Hence, once the JVM is 
started,
JDK 1.4 will not all any class loader in the process load alternate XML 
parsing
classes that fall in any package names listed in the following URL:

   http://java.sun.com/j2se/1.4/docs/guide/standards/index.html

The only way around this JDK 1.4 restriction for your webapp only is to 
create an
XML parser with package names that are not listed in the above URL (i.e. a 
very
non-standard parser).

There is another way around this restriction. However, it will force all 
webapps
(and the container itself) to use your XML parser. You can put your parser jar
files in the common/lib directory (4.0.x) or in the common/endorsed directory
(HEAD).
</quote>


Jake

At 03:16 AM 12/4/2002 -0800, you wrote:
>Hi All.
>
>I'm hoping someone can shed some light on my problem.  I'm trying to 
>upgrade from 4.0.6 to 4.1.16b and I'm finding that I'm unable to access 
>any JAR's in WEB-INF/lib.  Here's what I'm getting from localhost_log:
>
>2002-12-04 03:09:17 StandardContext[]: Starting
>2002-12-04 03:09:17 StandardContext[]: Processing start(), current 
>available=false
>2002-12-04 03:09:17 StandardContext[]: Configuring default Resources
>2002-12-04 03:09:17 StandardContext[]: Configuring non-privileged default 
>Loader
>2002-12-04 03:09:17 StandardContext[]: Configuring default Manager
>2002-12-04 03:09:17 StandardContext[]: Processing standard container startup
>2002-12-04 03:09:17 WebappLoader[]: Deploying class repositories to work 
>directory D:\Morpheus\Dev\PharmGen\runtime\tomcat\work\Standalone\localhost\_
>2002-12-04 03:09:17 WebappLoader[]: Deploy class files /WEB-INF/classes to 
>d:\Morpheus\Dev\PharmGen\www\WEB-INF\classes
>2002-12-04 03:09:17 WebappLoader[]: Deploy JAR /WEB-INF/lib/xalan.jar to 
>d:\Morpheus\Dev\PharmGen\www\WEB-INF\lib\xalan.jar
>2002-12-04 03:09:17 WebappLoader[]: Deploy JAR /WEB-INF/lib/xercesImpl.jar 
>to d:\Morpheus\Dev\PharmGen\www\WEB-INF\lib\xercesImpl.jar
>2002-12-04 03:09:17 WebappLoader[]: Deploy JAR 
>/WEB-INF/lib/xmlParserAPIs.jar to 
>d:\Morpheus\Dev\PharmGen\www\WEB-INF\lib\xmlParserAPIs.jar
>2002-12-04 03:09:17 WebappLoader[]: Reloading checks are enabled for this 
>Context
>2002-12-04 03:09:17 ContextConfig[]: ContextConfig: Processing START
>2002-12-04 03:09:17 StandardContext[]: Setting deployment descriptor 
>public ID to '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN'
>2002-12-04 03:09:18 StandardContext[]: Setting deployment descriptor 
>public ID to '-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN'
>2002-12-04 03:09:18 ContextConfig[]:  Accumulating TLD resource paths
>2002-12-04 03:09:18 ContextConfig[]:   Scanning <taglib> elements in web.xml
>2002-12-04 03:09:18 ContextConfig[]:   Scanning TLDs in /WEB-INF subdirectory
>2002-12-04 03:09:18 ContextConfig[]:   Scanning JARs in /WEB-INF/lib 
>subdirectory
>2002-12-04 03:09:18 ContextConfig[]:  Scanning JAR at resource path 
>'/WEB-INF/lib/xmlParserAPIs.jar'
>2002-12-04 03:09:18 ContextConfig[] Exception processing JAR at resource 
>path /WEB-INF/lib/xmlParserAPIs.jar
>javax.servlet.ServletException: Exception processing JAR at resource path 
>/WEB-INF/lib/xmlParserAPIs.jar
>    at 
> org.apache.catalina.startup.ContextConfig.tldScanJar(ContextConfig.java:930)
>    at 
> org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:868)
>    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:647)
>    at 
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:243)
>    at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
>    at 
> org.apache.catalina.core.StandardContext.start(StandardContext.java:3567)
>    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
>    at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
>    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
>    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
>    at 
> org.apache.catalina.core.StandardService.start(StandardService.java:497)
>    at org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
>    at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
>    at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
>    at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>    at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>    at java.lang.reflect.Method.invoke(Method.java:324)
>    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
>----- Root Cause -----
>java.io.IOException: The system cannot find the path specified
>    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
>    at java.io.File.checkAndCreate(File.java:1313)
>    at java.io.File.createTempFile(File.java:1401)
>    at java.io.File.createTempFile(File.java:1438)
>    at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:169)
>    at java.security.AccessController.doPrivileged(Native Method)
>    at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:164)
>    at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:42)
>    at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:78)
>    at 
> sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:85)
>    at 
> sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:69)
>    at 
> org.apache.catalina.startup.ContextConfig.tldScanJar(ContextConfig.java:906)
>    at 
> org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:868)
>    at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:647)
>    at 
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:243)
>    at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
>    at 
> org.apache.catalina.core.StandardContext.start(StandardContext.java:3567)
>    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
>    at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
>    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
>    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
>    at 
> org.apache.catalina.core.StandardService.start(StandardService.java:497)
>    at org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
>    at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
>    at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
>    at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>    at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>    at java.lang.reflect.Method.invoke(Method.java:324)
>    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
>
>
>I'm running Tomcat 4.1.16b on WinXP with JDK 1.4.1.  I've attached a copy 
>of my server.xml file.  My app works fine under Tomcat 4.0.6. Does anyone 
>have any ideas?  Am I doing something wrong, or is there a bug in Tomcat?
>
>Thanks,
>-Mark
>
>
>
>
>
><!-- A "Server" is a singleton element that represents the entire JVM,
>      which may contain one or more "Service" instances.  The Server
>      listens for a shutdown command on the indicated port.
>
>      Note:  A "Server" is not itself a "Container", so you may not
>      define subcomponents such as "Valves" or "Loggers" at this level.
>  -->
>
><Server port="6668" shutdown="SHUTDOWN" debug="0">
>
>   <!-- A "Service" is a collection of one or more "Connectors" that share
>        a single "Container" (and therefore the web applications visible
>        within that Container).  Normally, that Container is an "Engine",
>        but this is not required.
>
>        Note:  A "Service" is not itself a "Container", so you may not
>        define subcomponents such as "Valves" or "Loggers" at this level.
>    -->
>
>   <!-- Define the Tomcat Stand-Alone Service -->
>   <Service name="Tomcat-Standalone" debug="0">
>
>     <!-- A "Connector" represents an endpoint by which requests are received
>          and responses are returned.  Each Connector passes requests on 
> to the
>          associated "Container" (normally an Engine) for processing.
>
>          By default, a non-SSL HTTP/1.1 Connector is established on port 6666
>          You can also enable an SSL HTTP/1.1 Connector on port 8443 by
>          following the instructions below and uncommenting the second 
> Connector
>          entry.  SSL support requires the following steps (see the SSL Config
>          HOWTO in the Tomcat 4.0 documentation bundle for more detailed
>          instructions):
>          * Download and install JSSE 1.0.2 or later, and put the JAR files
>            into "$JAVA_HOME/jre/lib/ext".
>          * Execute:
>              %JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA 
> (Windows)
>              $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA  (Unix)
>            with a password value of "changeit" for both the certificate and
>            the keystore itself.
>
>          By default, DNS lookups are enabled when a web application calls
>          request.getRemoteHost().  This can have an adverse impact on
>          performance, so you can disable it by setting the
>          "enableLookups" attribute to "false".  When DNS lookups are 
> disabled,
>          request.getRemoteHost() will return the String version of the
>          IP address of the remote client.
>     -->
>
>     <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 6666
>
>          Note : To disable connection timeouts, set connectionTimeout
>         value to -1
>     -->
>     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
>                port="6666" minProcessors="5" maxProcessors="75"
>                enableLookups="false" redirectPort="8443"
>                acceptCount="10" connectionTimeout="60000"
>                debug="0" useURIValidationHack="false" />
>
>
>
>     <!-- An Engine represents the entry point (within Catalina) that 
> processes
>          every request.  The Engine implementation for Tomcat stand alone
>          analyzes the HTTP headers included with the request, and passes them
>          on to the appropriate Host (virtual host).
>     -->
>     <Engine name="Standalone" defaultHost="localhost" debug="0">
>
>       <!-- Global logger unless overridden at lower levels -->
>       <Logger className="org.apache.catalina.logger.FileLogger"
>               directory="logs" prefix="catalina_log." suffix=".txt"
>               timestamp="true"/>
>
>       <!-- Define the default virtual host -->
>       <Host name="localhost" appBase="webapps" unpackWARs="true" 
> autoDeploy="true"
>            debug="0">
>
>         <!-- Normally, users must authenticate themselves to each web app
>              individually.  Uncomment the following entry if you would like
>              a user to be authenticated the first time they encounter a
>              resource protected by a security constraint, and then have that
>              user identity maintained across *all* web applications contained
>              in this virtual host. -->
>         <Valve className="org.apache.catalina.authenticator.SingleSignOn"
>                    debug="0"/>
>
>         <!-- Access log processes all requests for this virtual host.  By
>              default, log files are created in the "logs" directory 
> relative to
>              $CATALINA_HOME.  If you wish, you can specify a different
>              directory with the "directory" attribute.  Specify either a 
> relative
>              (to $CATALINA_HOME) or absolute path to the desired directory.
>         -->
>         <Valve className="org.apache.catalina.valves.AccessLogValve"
>                directory="logs"  prefix="localhost_access_log." suffix=".txt"
>                  pattern="common" resolveHosts="false"/>
>
>         <!-- Logger shared by all Contexts related to this virtual host.  By
>              default (when using FileLogger), log files are created in 
> the "logs"
>              directory relative to $CATALINA_HOME.  If you wish, you can 
> specify
>              a different directory with the "directory" 
> attribute.  Specify either a
>              relative (to $CATALINA_HOME) or absolute path to the desired
>              directory.-->
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                 directory="logs"  prefix="localhost_log." suffix=".txt"
>                 timestamp="true"/>
>
>         <!-- Define properties for each web application.  This is only needed
>              if you want to set non-default properties, or have web 
> application
>              document roots in places other than the virtual host's appBase
>              directory.  -->
>
>         <!-- Tomcat Root Context -->
>         <Context path="" docBase="d:/Morpheus/Dev/PharmGen/www"
>                  reloadable="true" debug="2" />
>
>       </Host>
>
>     </Engine>
>
>   </Service>
>
></Server>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>