wood burning stoves 2.0*
The moose likes Tomcat and the fly likes I can't shutdown Tomcat! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "I can Watch "I can New topic
Author

I can't shutdown Tomcat!

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi, I'm in the process of configuring our server via SSH. We're hosted on a Linux platform. I managed to install java and tomcat. I started tomcat, pointed my browser to the URL and everything was fine. Now, there's this weird error that appeared when I tried to run the script shutdown.sh


root@server [/opt/apache-tomcat-5.0.17/bin]# ./shutdown.sh
Using CATALINA_BASE: /opt/apache-tomcat-5.0.17
Using CATALINA_HOME: /opt/apache-tomcat-5.0.17
Using CATALINA_TMPDIR: /opt/apache-tomcat-5.0.17/temp
Using JRE_HOME: /./usr/jdk1.5.0_07/
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.


what does this error mean?


SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
Lewin Chan
Ranch Hand

Joined: Oct 10, 2001
Posts: 214
That JRE_HOME looks a bit suspicious, while it's syntactically correct in the sense that the canonical resolution of /./usr/jdk1.5.0_07/ is in fact /usr/jdk1.5.0_07, you might be confusing something.

startup and shutdown.sh eventually call "catalina.sh". You should have a look at that, with particular reference to the "variables" that are documented at the top of file (JAVA_OPTS / CATALINA_OPTS being common culprits).

Scroll down to the section that actually does the "-stop", and echo the command line it's executing. you'd end up with something like.



And check for any obvious foolishness (like -Xmx128 which sets your max mem size to be 128 bytes, as opposed to -Xmx128m for instance)

catalina.sh is just a script, nothing terribly complicated.


I have no java certifications. This makes me a bad programmer. Ignore my post.
uday s
Greenhorn

Joined: Jan 31, 2006
Posts: 10
Hi
1.apart from checking /./usr/jdk1.5.0_07/ make sure your environment varialbles lik JAVA_HOME are set to absolute path not as temporarily for your session.

2.avoid having multiple JDK versions too.
these 2 issues caused me to have same error a while ago
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi, here is my .bash_profile and I'm logged in as root




I set the /./usr/jdk1.5.0_07/ IN JAVA_HOME implicitly because that's where the RPM installed the SDK. I have a 128 MB guaranteed memory just in case you need to know and max RAM of 8GB according to our provider. I'm hosted on a VPS and I think they did not mess up with our server yet by pre-installing it with an SDK or JRE. I'm a litle confused setting the JVM memory (-Xmx128), where and how do I do this. I appreciate your help guys. Thank you.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Are you running low on RAM in this machine?

Could not reserve enough space for object heap
Could not create the Java virtual machine.




Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi, just want to inform you guys that I solved the problem doing the following steps.

1. Upgrade my plan to a higher RAM, 256 guaranteed this time.
2. The above step still produced the same problem, but I was more sure this time that I had to do something with the JVM. So in my .bash_profile I put the following entries:



Thank you guys! I think this problem is solved. For those people with a VPS with less than 256 MB of guaranteed RAM, I suggest you upgrade to a higher plan. Then specify the above option in your environment variables. Thanks!
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Timothy,
Thanks for posting back with your solution.

You may want to consider moving your JAVA_OPTS declaration out of .bash_profile and into {tomcat install}/bin/catalina.sh. You will see notes on this in the header of the shell script.

This setting is specific to one application (Tomcat).
If you have a unix user that is only ever used for running Tomcat, this is not a big deal but if you log into this user for other things, then that environment variable may interfere with some other program.

It's best to keep app specific environment variables as local to that app as possible.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I can't shutdown Tomcat!
 
Similar Threads
port already in use
Running tomcat apache 5.5 on fedora 14 problem
how to set up JMX Remoting?
Tomcat startup problems
Tomcat 6 weird behavior