Bug 56236 - tomcat cannot startup since version 6.0.39,7.0.52,8.0 on some machines.
tomcat cannot startup since version 6.0.39,7.0.52,8.0 on some machines.
Status: RESOLVED INVALID
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
7.0.52
PC All
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2014-03-08 16:30 UTC by kean12
Modified: 2014-03-17 20:01 UTC (History)
0 users



Attachments
error log (3.78 KB, application/zip)
2014-03-08 16:30 UTC, kean12
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kean12 2014-03-08 16:30:51 UTC
Created attachment 31377 [details]
error log

Dear contributor
Since I upgrade my tomcat 7.0.47 to 7.0.52. those kind of issue was found and it is still not fixed yet.
this issue was also found on latest tomcate 6 and 8 version. 

I attach the error log. please check the attachment.

this issue was also repoerted by other user but they have not report to offical site yet.

same symptom:

http://stackoverflow.com/questions/21138279/tomcat-7-50jdk-64bit-1-7-0-51-start-up-issues

http://bbs.csdn.net/topics/390705454 (Chinese version site) 

environment:

OS: Win7  (64 BIT)
JDK :JDK7 with update 51 (64 bit.)

March 09, 2014 12:12:15 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0\bin;C:\server\tomcat 7\bin
March 09, 2014 12:12:15 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
March 09, 2014 12:12:15 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
March 09, 2014 12:12:15 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 797 ms
March 09, 2014 12:12:15 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
March 09, 2014 12:12:15 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52
March 09, 2014 12:12:15 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\server\tomcat 7\webapps\docs
March 09, 2014 12:12:16 AM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory C:\server\tomcat 7\webapps\docs
java.lang.ExceptionInInitializerError
	at org.apache.catalina.startup.ContextConfig.createWebXmlDigester(ContextConfig.java:515)
	at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:836)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:382)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NullPointerException
	at org.apache.tomcat.util.descriptor.DigesterFactory.idFor(DigesterFactory.java:107)
	at org.apache.tomcat.util.descriptor.DigesterFactory.<clinit>(DigesterFactory.java:59)
	... 18 more
March 09, 2014 12:12:16 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\server\tomcat 7\webapps\examples
March 09, 2014 12:12:16 AM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory C:\server\tomcat 7\webapps\examples
java.lang.NoClassDefFoundError: Could not initialize class org.apache.tomcat.util.descriptor.DigesterFactory
	at org.apache.catalina.startup.ContextConfig.createWebXmlDigester(ContextConfig.java:515)
	at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:836)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:382)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
March 09, 2014 12:12:16 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\server\tomcat 7\webapps\host-manager
March 09, 2014 12:12:16 AM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory C:\server\tomcat 7\webapps\host-manager
java.lang.NoClassDefFoundError: Could not initialize class org.apache.tomcat.util.descriptor.DigesterFactory
	at org.apache.catalina.startup.ContextConfig.createWebXmlDigester(ContextConfig.java:515)
	at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:836)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:382)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
March 09, 2014 12:12:16 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\server\tomcat 7\webapps\manager
March 09, 2014 12:12:16 AM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory C:\server\tomcat 7\webapps\manager
java.lang.NoClassDefFoundError: Could not initialize class org.apache.tomcat.util.descriptor.DigesterFactory
	at org.apache.catalina.startup.ContextConfig.createWebXmlDigester(ContextConfig.java:515)
	at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:836)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:382)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
March 09, 2014 12:12:16 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\server\tomcat 7\webapps\ROOT
March 09, 2014 12:12:16 AM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory C:\server\tomcat 7\webapps\ROOT
java.lang.NoClassDefFoundError: Could not initialize class org.apache.tomcat.util.descriptor.DigesterFactory
	at org.apache.catalina.startup.ContextConfig.createWebXmlDigester(ContextConfig.java:515)
	at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:836)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:382)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
	at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
March 09, 2014 12:12:16 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
March 09, 2014 12:12:16 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
March 09, 2014 12:12:16 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 191 ms
Comment 1 kean12 2014-03-08 16:32:12 UTC
incate the tomcat version
Comment 2 Konstantin Kolinko 2014-03-08 19:20:04 UTC
(In reply to kean12 from comment #0)
>
> INFO: Starting Servlet Engine: Apache Tomcat/7.0.52
>(...)
> SEVERE: Error deploying web application directory C:\server\tomcat
> 7\webapps\docs
>(...)
> Caused by: java.lang.NullPointerException
> 	at
> org.apache.tomcat.util.descriptor.DigesterFactory.idFor(DigesterFactory.java:
> 107)
> 	at
> org.apache.tomcat.util.descriptor.DigesterFactory.<clinit>(DigesterFactory.
> java:59)
>

This should have been fixed in the versions that you are using!

(Thanks to bugs 56045 and 56016 that have been reported for 7.0.50).

This behaviour of DigesterFactory is a result of our work on blocking CVE-2013-4590. Essentially, DigesterFactory populates a table with resource URLs of schema and DTD files bundled in Tomcat's servlet-api.jar.

This NPE happens when classloader cannot locate those files and returns 'null' instead of a valid URL.

My guess is that you have a mess either in your CLASSPATH or in CATALINA_BASE/lib, CATALINA_HOME/lib directories. Essentially that you have a rogue Servlet API jar file that does not belong to Tomcat.  That is that a classloader has loaded a wrong "javax.servlet.ServletContext" class that does not belong to our servlet-api.jar.
Comment 3 kean12 2014-03-09 02:56:14 UTC
Dear Konstantin Kolinko
thank you for your suggestion. your suggestion is correct after I clean up java folder and reinstall java.

Have a nice day
Comment 4 Konstantin Kolinko 2014-03-14 11:33:54 UTC
The behaviour was changed in 8.0.4, 7.0.53 (and proposed for 6.0.x) to log a warning instead of failing fatally with an NullPointerException.

The text of the warning will be:
 The XML schema [{0}] could not be found. This is very likely to break XML validation if XML validation is enabled.

Note though that in my opinion any configuration that uses wrong servlet-api JAR at runtime is a broken one.

Discussion:
http://marc.info/?t=139055909300001&r=1&w=2

[quote]
For example, Cookie.java relies on certain configuration properties
defined by Tomcat documentation to provide secure and
specification-compliant behaviour.  You cannot swap that
implementation with random other.
[/quote]
Comment 5 Konstantin Kolinko 2014-03-17 20:01:17 UTC
(In reply to Konstantin Kolinko from comment #4)
> The behaviour was changed in 8.0.4, 7.0.53 (and proposed for 6.0.x) to log a
> warning instead of failing fatally with an NullPointerException.
> 

Applied to Tomcat 6 as well in r1578369, will be in 6.0.40.

> Note though that in my opinion any configuration that uses wrong
> servlet-api JAR at runtime is a broken one.