Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat server restarted automatically

 
Aby Arackal peter
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using Tomcat 5.5.17 in Production.From the last few days the server is restarting automatically.Why it is happening?

Before, I have increased the tomcat memory.

For that I have used the command ' export JAVA_OPTS="-Xms256m -Xmx512m -XX:MaxPermSize=128m" '.

kindly give me a solution. Its very urgent.

thanks,

Aby


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Aby Arackal peter wrote:Its very urgent.

Please read EaseUp to understand why this is not going to make anyone answer faster. Quite the opposite, in fact.
 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out your Tomcat logs.
 
Aby Arackal peter
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Please see the portion of the server logs.

org.hibernate.TransactionException: Transaction not successfully started

Jan 24, 2012 11:03:48 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(/usr/local/apache-tomcat-5.5.17/webapps/CT/WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Jan 24, 2012 11:04:13 AM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-80
Jan 24, 2012 11:04:14 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jan 24, 2012 11:04:14 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/70 config=null
Jan 24, 2012 11:04:14 AM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
DB PoolWatcher
Jan 24, 2012 11:04:14 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 40659 ms

This is repeatedly coming in the log.

Thanks,

Aby

 
Tim Moores
Bartender
Posts: 2789
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That all looks OK (except for the Hibernate error, but that most likely has nothing to do with Tomcat).

But Tocmat does not restart itself; there must be a script or some other external process that does that.
 
Aby Arackal peter
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks Tim .

Also Please tell me about the command export JAVA_OPTS="-Xms256m -Xmx512m -XX:MaxPermSize=128m". Because already I have applied this command in tomcat ' setenv.sh' file for increasing memory.

is it any problem?

Thanks,

Aby
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I'm reading the log correctly, the WAR is defective. It contains a "servlet-api.jar" file in it which will conflict with the servlet-api.jar in the Tomcat server library directory, and that would definitely be enough to scramble the webapp's brains at least, if not actually bring down Tomcat.

A note about setenv.sh: If you're coding the "export" on your environment setting, don't do that. All you need is the "name=value" setting. This file is "source"d by the Tomcat script, so the environment is already propagated correctly without the need to export it.
 
Tim Moores
Bartender
Posts: 2789
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:It contains a "servlet-api.jar" file in it which will conflict with the servlet-api.jar in the Tomcat server library directory, and that would definitely be enough to scramble the webapp's brains at least, if not actually bring down Tomcat.

I fairly certain that it won't. Tomcat is smart enough not to load the classes contained in servlet-api.jar and jsp-api.jar (that's what that message says, after all). I've taken a look at web apps that contained those jars in WEB-INF/lib for years without problems. Nonetheless, the jar file should be removed.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:
Tim Holloway wrote:It contains a "servlet-api.jar" file in it which will conflict with the servlet-api.jar in the Tomcat server library directory, and that would definitely be enough to scramble the webapp's brains at least, if not actually bring down Tomcat.

I fairly certain that it won't. Tomcat is smart enough not to load the classes contained in servlet-api.jar and jsp-api.jar (that's what that message says, after all). I've taken a look at web apps that contained those jars in WEB-INF/lib for years without problems. Nonetheless, the jar file should be removed.


True up to a point. However, the warning has 2 purposes. Firstly, WARs are supposed to be portable, and this is a warning that less diligent servers than Tomcat could have trouble. Secondly, servlet-api.jar is unversioned. Which means that a webapp could be using an API that's out of sync with the Tomcat servlet-impl.jar.

So the servlet-api.jar should definitely be removed. Also a check should be made that there's no copy of the servlet-impl.jar in the WAR, just in case Tomcat didn't see fit to warn.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic