2

I have a feeling that there might be something wrong with my Tomcat installation, so I run the following command for sanity check.

$TOMCAT_HOME/bin/catalina.sh configtest

What does this output mean, or how to go about fixing? Thinking of re-installing Tomcat. OS is Ubuntu.

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

Jul 01, 2016 12:28:41 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]

Jul 01, 2016 12:28:41 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]

Jul 01, 2016 12:28:41 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]

Jul 01, 2016 12:28:41 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]

Jul 01, 2016 12:28:41 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]

Jul 01, 2016 12:28:41 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]

Jul 01, 2016 12:28:41 AM org.apache.catalina.startup.Catalina initDirs
SEVERE: Cannot find specified temporary folder at /usr/share/tomcat7/temp

Jul 01, 2016 12:28:41 AM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/usr/share/tomcat7/conf/server.xml]

Configuration error detected!
leopal
  • 4,711
  • 1
  • 25
  • 35
nikk
  • 2,627
  • 5
  • 30
  • 51
  • looks like user by which you are running tomcat doesn't have access to /usr/share/tomcat folder. please check access and run. – nat Jul 01 '16 at 06:17
  • The user has sudo access. The folders with the errors above do indeed not exist. Which is weired because installing Tomcat should have installed the folders. – nikk Jul 01 '16 at 07:57

3 Answers3

1

I had the same problem. I was running Tomcat 7 on Ubuntu 14.04. The problem is in the file catalina.properties. In my computer it is located in /var/lib/tomcat7/conf/.

This file has a lot of paths with the variables ${catalina.base} and ${catalina.home}. This variables are set in the file catalina.sh. In my computer it is located in /usr/share/tomcat7/bin/.

For some reason the Tomcat 7 is using the ${catalina.home} wich is /usr/share/tomcat7/ instead of ${catalina.base} wich is /var/lib/tomcat7/.

To correct this you need to replace the texts below:

  • ${catalina.home}/common/classes => ${catalina.base}/common/classes
  • ${catalina.home}/common/.jar => ${catalina.base}/common/.jar
  • ${catalina.home}/server/classes => ${catalina.base}/server/classes
  • ${catalina.home}/server/.jar => ${catalina.base}/server/.jar
  • ${catalina.home}/shared/classes => ${catalina.base}/shared/classes
  • ${catalina.home}/shared/.jar => ${catalina.base}/shared/.jar

After the replacements, run configtest.sh again to verify.

  • This was also [reported as a](https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1232258) for tomcat7. – matthaeus Mar 27 '17 at 13:07
0

you can modify or add setenv.sh file in bin folder of your tomcat as below

export JAVA_HOME="[your java home]"
export CATALINA_BASE="[your tomcat home]"
export CATALINA_HOME=" [ your tomcat home]"
export CATALINA_PID="$CATALINA_BASE/logs/tomcat.pid"

This fix work for me.

Chamly Idunil
  • 1,848
  • 1
  • 18
  • 33
0

I ran into this after upgrading an Ubuntu 16.04 box to 18.04. As part of the upgrade I merged the Tomcat 8 settings to an existing Tomcat 7 file and forgot to remove these two lines:

<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />

Only the last one was actually causing issues, but if you yank it you will probably want to remove the related comment too.

After making that change, I was able to start Tomcat 8 on the newly upgraded box without issue.

deoren
  • 399
  • 3
  • 6