Tocat starts fine using ./startup.sh, but after a while is not responding and I have to shut it down and start it again, am I missing something. I'm using Tomcat Web Server/3.2.3 (JSP 1.1; Servlet 2.2; Java 1.3.1; Linux 2.2.16C32_III i386.
Run the JVM verbose (esp. gc). Monitor the system with top (or xload or xosview or whatever) and try to determine if the systems displays characteristic behaviour just before (and while) Tomcat does not respond. GC sometimes takes a long time and gobbles up those CPU cycles.
When not responding, all the java processes still there, using top. Sometimes I can see on my telnet window how the processes are being removed, it only says, "removing context ......." a lot of times, and then stop working. and I have to restart it again, also every time it does its thing, rewrites my server.xml file and change all configuration. and there we go again.
Thank you very much for your time.
Uh, I meant to say monitor the CPU usage, not processes...
Anyway, you may have hit a well-known bug in Tomcat. Tomcat will hit the %100 CPU mark on removal of the root context -rarely on non-root contexts as well- Do you by any chance deploy your app on the root context (e.g., /index.jsp)?
The cpu highest mark is around 14 % when I run the site. I do not know exactly what you mean by "running it in the root context" this is when I run .../index.jsp,?
Is that the problem?
My project is not an app yet.
So much to learn, so little time.
Thank you very much
I cannot follow exactly what is your problem. But the same problem i also faced and solved it once.After you start the tomcat i beleive you tried to run the jsp file, if so check whether you have used the command System.exit(); by any means. This is one possibility where the tomcat server will automatically shutdown. Else it could be because of the contextmanager.
Finally after long sleepless nights, found out that it is a security problem, I believe. something with the java.security.AccessControlException, I have granted permissions to everything and still....
could you give me your opinion on this?
Thank you for your time.
I checked my code and I couldn't find anything wrong, Do you know how to run it without the security feature, just to see if that solves my problem.?
Thank you again
To bypass all Tomcat security:
Fire up the JDK policytool, open <tomcat-directory>/conf/catalina.policy, add AllPermissions to codebase <ALL>.
I'm really messed up here!. I looked for catalina and she does not live in my server.
I modified tomcat.policy and granted 'all permissions' to almost all.
I used to work on a system where you just set the context and that was all. Now this context manager takes over and writes contexts for everything.
I'm working with virtual hosts and I think things change a bit.
Thank you very much again!
A context is the path you deploy your web components. For example, if you deploy to context "/myapp" you can access the app with the URL http://localhost/myapp/index.jsp
. The root context is "/". If you access your application with http://localhost/index.jsp
, you are deploying to the root context and this is known to have side effects in Tomcat.
CPU usage will go up to 100% and no requests (for even other apps) will be processed when Tomcat gets stuck.