You are not logged in.

#1 2013-02-07 16:10:46

From: Ghent
Registered: 2011-10-27
Posts: 7

Tomcat 6 not starting

Hello, for work I need to set up a local development environment with tomcat. Since we're going to deploy tomcat6, I want to install and run tomcat6.

I installed tomcat6 through pacman. I'm using jdk from the AUR, which lives in /opt/java (containing a jre folder).

I have set the environment variable JAVA_HOME in my bashrc, source'd it. The file /etc/profiles.d/ contains

export J2SDKDIR=/opt/java
export J2REDIR=/opt/java/jre
export PATH=$PATH:/opt/java/bin:/opt/java/db/bin:/opt/java/jre/bin
export JAVA_HOME=/opt/java
export DERBY_HOME=/opt/java/db

which seems correct.

I try to start tomcat by issuing

sudo systemctl start tomcat6

Obviously, it doesn't work.


[bbt@bbt-laptop share]$ sudo systemctl status tomcat6
tomcat6.service - Tomcat 6 servlet container
	  Loaded: loaded (/usr/lib/systemd/system/tomcat6.service; disabled)
	  Active: failed (Result: exit-code) since Thu 2013-02-07 17:03:27 CET; 8s ago
	 Process: 21365 ExecStart=/usr/bin/jsvc -Dcatalina.home=${CATALINA_HOME} -Dcatalina.base=${CATALINA_BASE} -cp /usr/share/java/commons-daemon.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar -user tomcat -java-home ${TOMCAT_JAVA_HOME} -wait 10 -pidfile /var/run/ -errfile /var/log/tomcat6/catalina.err -outfile /var/log/tomcat6/catalina.out $CATALINA_OPTS org.apache.catalina.startup.Bootstrap (code=exited, status=1/FAILURE)

Feb 07 17:03:27 bbt-laptop systemd[1]: Starting Tomcat 6 servlet container...
Feb 07 17:03:27 bbt-laptop jsvc[21365]: Cannot locate Java Home
Feb 07 17:03:27 bbt-laptop systemd[1]: tomcat6.service: control process exited, code=exited status=1
Feb 07 17:03:27 bbt-laptop systemd[1]: Failed to start Tomcat 6 servlet container.
Feb 07 17:03:27 bbt-laptop systemd[1]: Unit tomcat6.service entered failed state
[bbt@bbt-laptop share]$ 

I keep getting 'Cannot locate Java Home'. Any ideas?

Edit: update, by invoking the script the server is running. I don't get it.

Last edited by BBT (2013-02-07 16:26:09)


#2 2013-08-27 12:45:08

From: Macedonia
Registered: 2007-10-21
Posts: 46

Re: Tomcat 6 not starting

Edit the  /usr/lib/systemd/system/tomcat6.service change the Environment=TOMCAT_JAVA_HOME=/opt/java to whatever is your JDK located at.
then issue this:

sudo systemctl --system daemon-reload

Now just start the service as usual:

sudo systemctl start tomcat6

Maybe someone will find this helpful.

Last edited by gnu_D (2013-08-27 12:46:08)

:: Python powered FOREVER ::


Board footer

Powered by FluxBB