You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by sthirumalai <s_...@yahoo.com> on 2008/10/01 14:10:16 UTC

Tomcat servlet instantiation error

We build an exe which will have tomcat, jdk and our code in it. When we
install that in some system it installs perfectly but while accessing the
service it throws servlet instantiation error. This also happens for the
first time. If we restart that system everything works well. What may be the
issue?

2008-09-24 14:42:52 StandardContext[]Marking servlet CMLogin as unavailable
2008-09-24 14:42:53 StandardWrapperValve[CMLogin]: Allocate exception for
servlet CMLogin
javax.servlet.ServletException: Error instantiating servlet class
cmservelt.CMLoginServlet
	at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1011)
	at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:712)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:187)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
	at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
	at java.lang.Thread.run(Thread.java:534)
----- Root Cause -----
java.lang.ExceptionInInitializerError
	at cmservelt.CMLoginServlet.<clinit>(CMLoginServlet.java:42)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
	at java.lang.Class.newInstance0(Class.java:308)
	at java.lang.Class.newInstance(Class.java:261)
	at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1002)
	at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:712)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:187)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
	at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
	at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
	at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
	at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.NullPointerException
	at java.io.FileInputStream.<init>(FileInputStream.java:103)
	at java.io.FileInputStream.<init>(FileInputStream.java:66)
	at java.io.FileReader.<init>(FileReader.java:41)
	at data.UserFile.ReadFile(UserFile.java:76)
	at model.UserCollection.<clinit>(UserCollection.java:17)
	... 31 more


-- 
View this message in context: http://www.nabble.com/Tomcat-servlet-instantiation-error-tp19759091p19759091.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat servlet instantiation error

Posted by Sai Pullabhotla <ps...@linoma.com>.
Not sure if this is related at all... but here it goes: 

We do the same thing as you were doing, bundle Tomcat and our application
into an installer package. During the packaging, we did not package
"tomcat/logs" directory. Tomcat fails to start properly. But if we do a
shutdown and start it back, everything works like a charm. The reason we
found for this was - the Shutdown command creates the "tomcat/logs"
directory and hence the subsequent startups work with no issues. 

Sai Pullabhotla
Senior Architect
Linoma Software 
1409 Silver St
Ashland, NE 68003 
(402) 944 4242 x 716/754
(800) 949 4696 x 716/754
www.linomasoftware.com
 
-----Original Message-----
From: sthirumalai [mailto:s_thiruven@yahoo.com] 
Sent: Wednesday, October 01, 2008 9:02 AM
To: users@tomcat.apache.org
Subject: Re: Tomcat servlet instantiation error


That null pointer error goes off after some time. I am not sure but I think
that is because of file(s) updation with windows. After some time I get this
error only in the browser.

HTTP Status 404 - Servlet CMLogin is not available
Status report
message Servlet CMLogin is not available
description The requested resource (Servlet CMLogin is not available) is not
available.

The servlet is there and it is configured correctly in the web.xml. The
mystery is why it works after restarting the system. 






-- 
View this message in context:
http://www.nabble.com/Tomcat-servlet-instantiation-error-tp19759091p19761188
.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3485 (20081001) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 3485 (20081001) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat servlet instantiation error

Posted by sthirumalai <s_...@yahoo.com>.
That null pointer error goes off after some time. I am not sure but I think
that is because of file(s) updation with windows. After some time I get this
error only in the browser.

HTTP Status 404 - Servlet CMLogin is not available
Status report
message Servlet CMLogin is not available
description The requested resource (Servlet CMLogin is not available) is not
available.

The servlet is there and it is configured correctly in the web.xml. The
mystery is why it works after restarting the system. 






-- 
View this message in context: http://www.nabble.com/Tomcat-servlet-instantiation-error-tp19759091p19761188.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat servlet instantiation error

Posted by Mark Thomas <ma...@apache.org>.
sthirumalai wrote:
> We build an exe which will have tomcat, jdk and our code in it. When we
> install that in some system it installs perfectly but while accessing the
> service it throws servlet instantiation error. This also happens for the
> first time. If we restart that system everything works well. What may be the
> issue?

The answer appears to be in your stack strace.
> 
> 2008-09-24 14:42:53 StandardWrapperValve[CMLogin]: Allocate exception for
> servlet CMLogin
> javax.servlet.ServletException: Error instantiating servlet class
> cmservelt.CMLoginServlet
<snip/>
> ----- Root Cause -----
> java.lang.ExceptionInInitializerError
> 	at cmservelt.CMLoginServlet.<clinit>(CMLoginServlet.java:42)
<snip/>
> Caused by: java.lang.NullPointerException
> 	at java.io.FileInputStream.<init>(FileInputStream.java:103)
> 	at java.io.FileInputStream.<init>(FileInputStream.java:66)
> 	at java.io.FileReader.<init>(FileReader.java:41)
> 	at data.UserFile.ReadFile(UserFile.java:76)
> 	at model.UserCollection.<clinit>(UserCollection.java:17)
> 	... 31 more

The root cause is a NPE on line 17 of model.UserCollection. You'll have to
look at your source code to figure out exactly which object is null and why.

Mark



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org