• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat server restarted automatically

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out your Tomcat logs.
 
Aby Arackal peter
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I'm thinking about a new battle cry. Maybe "Not in the face! Not in the face!" Any thoughts tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic