• 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
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

I can't shutdown Tomcat!

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you running low on RAM in this machine?


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


 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic