tomcat7.service failed to start

19.7k Views Asked by At

I have a Server running tomcat7, when I try to restart the tomcat7 service it says:

Job for tomcat7.service failed because the control process exited with error code. See "systemctl status tomcat7.service" and "journalctl -xe" for details.

When i check my systemctl status tomcat7.service, it gives me:

    tomcat7.service - LSB: Start Tomcat.
   Loaded: loaded (/etc/init.d/tomcat7; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2016-12-20 11:19:29 UTC; 5min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 5223 ExecStart=/etc/init.d/tomcat7 start (code=exited, status=1/FAILURE)

Dec 20 11:19:24 padrum systemd[1]: Starting LSB: Start Tomcat....
Dec 20 11:19:24 padrum tomcat7[5223]:  * Starting Tomcat servlet engine tomcat7
Dec 20 11:19:29 padrum tomcat7[5223]:    ...fail!
Dec 20 11:19:29 padrum systemd[1]: tomcat7.service: Control process exited, code=exited status=1
Dec 20 11:19:29 padrum systemd[1]: Failed to start LSB: Start Tomcat..
Dec 20 11:19:29 padrum systemd[1]: tomcat7.service: Unit entered failed state.
Dec 20 11:19:29 padrum systemd[1]: tomcat7.service: Failed with result 'exit-code'.

I tried uninstalling it with dpkg -P and apt-get remove. everytime I try to reinstall it it gives me an error that i can't run my tomcat7.

Any ideas? Thanks in advance

4

There are 4 best solutions below

0
On BEST ANSWER

I had a similar issue, turns out that setenv.sh file in /usr/share/tomcat/tomcat8/bin had a line that points to JAVA_HOME. I commented that by adding # before that line and restarting tomcat. It worked!

0
On

WE had a similar problem. The tomcat7 would NOT launch from the startup scripts no matter what we did. But if we ran the command in the startup script directly from the command line it would load into memory just fine.

0
On

This can also happen if you wrote catalina.out, etc. into the logs directory with root permission or some other permission so that tomcat can't overwrite it.

0
On

I got this error using this line in setenv.sh (In /usr/share/tomcat8/bin):

#export CATALINA_OPTS=”$CATALINA_OPTS -server -Xms600m -Xmx1200m”
export CATALINA_OPTS="$CATALINA_OPTS -server -Xms600m -Xmx1200m"

was fixed using the second line, you can see that the error was to use ” char instead of " char (due to that was copied in this way from a web page)