3

I have tomcat7 running on server for helpdesk ticketing system (SysAid). After a reboot the tomcat7 service does not start up.

In my catalina.out file when I grep for tomcat7 I get the following: WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false] WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false] WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false] WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false] WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false] WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false] INFO: Deploying web application archive /var/lib/tomcat7/webapps/sysaid.war WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false] WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false] WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false] WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false] WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false] WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false] INFO: Deploying web application archive /var/lib/tomcat7/webapps/sysaid.war Initializing log4j with: /var/lib/tomcat7/webapps/sysaid/./WEB-INF/log4j.properties Initializing log4j with: /var/lib/tomcat7/webapps/sysaid/./WEB-INF/log4j.properties INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT

The help desk program log files show no mention of tomcat7 errors.

When I run a startup script for the program I get the following: Using CATALINA_BASE: /usr/share/tomcat7 Using CATALINA_HOME: /usr/share/tomcat7 Using CATALINA_TMPDIR: /usr/share/tomcat7/temp Using JRE_HOME: /usr Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar touch: cannot touch ‘/usr/share/tomcat7/logs/catalina.out’: No such file or directory ./catalina.sh: 385: ./catalina.sh: cannot create /usr/share/tomcat7/logs/catalina.out: Directory nonexistent

I also checked to make sure it was already set to run at startup through rc.d with the command: sudo update-rc.d tomcat7 defaults

Here's what I get: System start/stop links for /etc/init.d/tomcat7 already exist.

I've removed it and re-added it, with no change. Can someone help me? Thanks in advance.

2

Check this to see if it is related:

Tomcat7 installation failed via apt-get on Ubuntu 14.04

Basically, there is a dependency that may be missing (fixed with sudo apt-get install libtomcat7-java), but assuming you already did this, it seems the apt-get package is generically FUBAR and requires post-install massaging (which typically I don't recommend as apt-get reconfigure or other package commands may result in undesirable consequences).

Thus, installing the .tgz (from Apache) manually may be the most stable path of least resistance.

  • Here's my results: libtomcat7-java is already the newest version. libtomcat7-java set to manually installed. So it looks like it's already updated. I guess I'll try the .tgz install manually. – Winski Tech Mar 10 '15 at 12:53
  • A complete reinstall of the program did not work. I additionally flushed out the logs and let the program recreate them, this did not help. – Winski Tech Mar 12 '15 at 19:54
  • Not entirely surprising. Did you look in any logs and more importantly, are the log errors different this time? For instance, instead of missing files/directories, this time it might be apparmor or some other issue that might not have occurred using a proper debian package. – Andrew Mar 12 '15 at 20:29
2

The problem is with your system variables.

You've CATALINA_HOME defined, but there is no CATALINA_BASE, therefore by default it's the same as CATALINA_HOME, but it's not correct.

CATALINA_BASE: (Optional) Base directory for resolving dynamic portions of a Catalina installation. If not present, resolves to the same directory that CATALINA_HOME points to.

Normally you should see something like:

# /usr/share/tomcat7/bin/catalina.sh run 
Using CATALINA_BASE:   /var/lib/tomcat7
Using CATALINA_HOME:   /usr/share/tomcat7
Using CATALINA_TMPDIR: /tmp
Using JRE_HOME:        /usr/lib/jvm/java-7-openjdk-amd64
Using CLASSPATH:       /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
Using CATALINA_PID:    /var/run/tomcat7.pid

If these variables are not present, either you may define them manually:

. /etc/default/tomcat7
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 CATALINA_HOME=/usr/share/tomcat7 CATALINA_BASE=/var/lib/tomcat7 CATALINA_PID=/var/run/tomcat7.pid CATALINA_TMPDIR=/tmp
/usr/share/tomcat7/bin/catalina.sh run

or configure your /etc/init.d/tomcat7 startup script correctly, as normally it should have these variables at the end:

# Directory where the Tomcat 6 binary distribution resides
CATALINA_HOME=/usr/share/$NAME

# Directory for per-instance configuration files and webapps
CATALINA_BASE=/var/lib/$NAME

Check content of catalina.sh for more details, as it describes all Environment Variable Prerequisites.

Otherwise re-install your Tomcat.

0

I also ran into the issue of directory problems. It was after I had removed tomcat 7 and tried reinstalling it. When I had first removed it though, I didn't touch the libtomcat7-java package. Once I ran into the fact it might be that package causing the problem, I did a full removal and reinstall and Tomcat came right up:

Remove (making sure to include the libtomcat7-java package this time):

sudo apt-get remove --purge tomcat7 tomcat7-docs tomcat7-admin tomcat7-examples libtomcat7-java

Reinstall:

sudo apt-get install tomcat7 tomcat7-docs tomcat7-admin tomcat7-examples libtomcat7-java

The first thing you'll notice is that tomcat will start on it's own without an issue. Then you can continue to configure it properly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.