Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie question: how do you force tomcat to restart?

Status
Not open for further replies.

mboswort

Programmer
May 23, 2006
16
US
There's no tomcat in my task manager b/c this computer's not the server - I'm on a company computer. Tomcat seems to be crashing and I want to shut it down and restart it. What do I do? Please help.
 
There will never be a "Tomcat" in your task manager, because Tomcat is run inside a JVM, which shows in your process list on Win32 as "java.exe"

You should stop and start it as you do normally ...

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Tomcat is running on a unix server. My computer is not that server. I was told to "sudo tomcat" and then run the shutdown script in order to shut the server down. How do I do this? I'm not acquainted with the sudo command on unix.
 
Thats a question for the linux forum really ...

But, if Tomcat is running as the user "joe" :

Code:
su - joe

Then enter the password for that user.

Then run the shutdown script. If Tomcat is installed in /usr/local/tomcat :

Code:
/usr/local/tomcat/bin/catalina.sh stop
pkill -9 java

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Thanks.

I ran

su -u tomcat ./shutdown.sh

and got:

./shutdown.sh: /proj/bo/apps/db-dev/apps/jakarta-tomcat-5.0.28-bo/bin/catalina.s: bad interpreter: No such file or directory
./shutdown.sh: line 38: /proj/bo/apps/db-dev/apps/jakarta-tomcat-5.0.28-bo/bin/catalina.sh: Success

I then tried accessing the tomcat server from a browser, and it was still up. So the shut down must not have worked.

I run shutdown again, and now I get this message:
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 18134; nested exception is:
java.net.BindException: Address already in use
 
pkill -9 java

and

sudo -u tomcat pkill -9 java

return: operation not permitted
 
Post the results of :

ps -ef | grep java

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
root 20877 1 0 Mar30 ? 00:43:32 /usr/local/jdk/bin/java -Dinstall4j.jvmDir=/usr/local/jdk -Dinstall4j.appDir=/opt/ejtserver -Dexe4j.moduleName=/opt/ejtserver/bin/ejtserver -classpath /opt/ejtserver/.install4j/i4jruntime.jar:/opt/ejtserver/bin/license.jar com.install4j.runtime.Launcher start com.ejt.lice
mboswort 4692 4231 0 12:46 pts/3 00:00:00 grep java
 
OK, thats fine then - you've killed off tomcat successfully by the looks of it.
The other java process looks to be some other app.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
the server went down. that's good. i'm trying to restart it now.
 
i was hoping that restarting it would fix this problem, but for some reason a handful - about 1/2 - of the webapps suddenly can't start. when i run the admin program, and examine the contexts for any programs that are not running, there is always an error saying that an attribute could not be retrieved.
 
So what are the errors in Tomcat's logs ?

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
2006-05-24 14:08:52 StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: ], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: ], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: ]]
2006-05-24 14:08:54 StandardContext[/demo]Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.NoClassDefFoundError: javax/faces/el/VariableResolver
at java.lang.ClassLoader.defineClass1(Native Method)
at..at..at...at.......at...
 
also, here's something that is really weird and might be related.

in my catalina.properties file, common.loader is originally:
common.loader=${catalina.home}/common/classes,\
${catalina.home}/common/endorsed/*.jar,\
${catalina.home}/common/lib/*.jar

Then, when I append one line at the end:
common.loader=${catalina.home}/common/classes,\
${catalina.home}/common/endorsed/*.jar,\
${catalina.home}/common/lib/*.jar,\
${catalina.home}/common/lib/ext/*.jar

Suddenly the tomcat server is missing like 5 web apps and, if u look in the admin program, many more contexts. How weird is that...
 
Looks like the "demo" webapp is missing some JSF classes : javax/faces/el/VariableResolver

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
sry, but what does this mean? "javax/faces/el/VariableResolver" ...
 
Looks like the "demo" webapp is missing a .jar file which contains the class ""javax/faces/el/VariableResolver", which by the sounds of it is a JavaServerFaces framework class

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top