PDA

View Full Version : [ubuntu] Problem with using tomcat startup/shutdown.sh


r1ch
December 21st, 2008, 07:34 PM
Hi,
Is anyone able to offer some help with the following problem please?

I have installed tomcat6 from synaptic and after viewing http://localhost:8080 it shows the "it works" screen and shows my catalina variables as being...

CATALINA_HOME=/usr/share/tomcat6
CATALINA_BASE=/var/lib/tomcat6

...however running the shutdown script gives the following error...

Using CATALINA_BASE: /usr/share/tomcat6
Using CATALINA_HOME: /usr/share/tomcat6
Using CATALINA_TMPDIR: /usr/share/tomcat6/temp
Using JRE_HOME: /usr
21-Dec-2008 23:24:39 org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.io.FileNotFoundException: /usr/share/tomcat6/conf/server.xml (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:137)
at org.apache.catalina.startup.Catalina.stopServer(Ca talina.java:407)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.catalina.startup.Bootstrap.stopServer(B ootstrap.java:337)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:415)


...this shows the catalina base and home being the same. I'm not worried whether I have a seperate instance or not but have been unable to either find a way to change the CATALINA_BASE value to be what it should be or to change the installation so that it does not have the seperate instance.

Any ideas and suggestions or pointers to a solution would be very gratefully received.

Drezard
December 22nd, 2008, 12:48 AM
Read this error here:


java.io.FileNotFoundException: /usr/share/tomcat6/conf/server.xml (No such file or directory)


Thats all you should need :-)

r1ch
December 22nd, 2008, 01:34 PM
Thankyou for your reply Drezard. Unfortunately I do already have the file and directory structure mentioned by the java exception, but it is present in the previously mentioned CATALINA_BASE=var/lib/tomcat6 directory whereas the actual value for C_BASE in the server instance is the same as CATALINA_HOME which is =usr/share/tomcat6.

I suspect that your suggestion that I copy the folder/files over from one place to the other may solve this problem but as I don't know what other dependencies I may be affecting if I do this, I was hoping to alter the 'BASE value to be the 'correct' one mentioned by the server on its welcome page, which would presumably do the trick.

Does anyone know how I can change such a variable please?

wsfulton
January 12th, 2009, 07:01 PM
I had the same problem, but using the new way to start/stop services introduced in Intrepid Ibex works nicely:


$ sudo service tomcat6 stop
* Stopping Tomcat servlet engine tomcat6 [ OK ]
$ sudo service tomcat6 start
* Starting Tomcat servlet engine tomcat6 [ OK ]
$


or of course the more traditional way:


$ sudo /etc/init.d/tomcat6 stop
* Stopping Tomcat servlet engine tomcat6 [ OK ]
$ sudo /etc/init.d/tomcat6 start
* Starting Tomcat servlet engine tomcat6 [ OK ]
$

nikhilbhardwaj
June 29th, 2009, 07:47 AM
thanks a lot
the method of starting up services worked for me

eazyigz
January 8th, 2010, 03:14 PM
This worked for me too. Thank you.

Tricia Bowen
January 26th, 2010, 02:57 PM
I had the same problem, but using the new way to start/stop services introduced in Intrepid Ibex works nicely:


$ sudo service tomcat6 stop
* Stopping Tomcat servlet engine tomcat6 [ OK ]
$ sudo service tomcat6 start
* Starting Tomcat servlet engine tomcat6 [ OK ]
$


or of course the more traditional way:


$ sudo /etc/init.d/tomcat6 stop
* Stopping Tomcat servlet engine tomcat6 [ OK ]
$ sudo /etc/init.d/tomcat6 start
* Starting Tomcat servlet engine tomcat6 [ OK ]
$

Thanks, this worked.

pwiggins
March 22nd, 2011, 02:04 PM
I spent a couple of hours searching for a fix and figure I'll post what I found here.

Beware... Mgmnt type dusting off nonexistent skill; 6hours into creating a Ubuntu Virtualbox guest for webapp testing... in other words don't trust a thing I type.

My hack fix was to create a link where tomcat wanted it to the existing server.xml file.
- create a conf directory in /usr/share/tomcat6
- create the link server.xml and point it to the existing /etc/tomcat6/server.xml

That solved my start/stop with:
- startup.sh
- shutdown.sh
- ./catalina.sh [run/stop]

BUT.. I had a severe cannon find /usr/share/tomcat6/tmp... yup... 2nd manual hack, simply created that directory. All is well so far.
-Paul