0

I'm facing an issue while installing Tomcat7 in Ubuntu 14.04. The JDK is already installed on my system (1.7 version), but when I use apt-get install tomcat7 I get the below error:

Setting up tomcat7-common (7.0.52-1ubuntu0.1) ...
Setting up tomcat7 (7.0.52-1ubuntu0.1) ...

Creating config file /etc/default/tomcat7 with new version
Adding system user `tomcat7' (UID 108) ...
Adding new user `tomcat7' (UID 108) with group `tomcat7' ...
Not creating home directory `/usr/share/tomcat7'.

Creating config file /etc/logrotate.d/tomcat7 with new version
 * Starting Tomcat servlet engine tomcat7                                **[fail]**

I tried all solutions I could find on the Internet, like:

  1. Uninstalled tomcat7 using apt-get purge tomcat7 or apt-get autoremove tomcat7 and again installed but got the same error. :(

  2. Tried apt-get update, remove tomcat7 and again installed but failed.

  3. Set the CATALINA path in .bashrc or /etc/environment. But got no luck.

Note: I have installed the same tomcat7 on my local Ubuntu 14.04 server and it installed correctly in a first attempt.

1

4 Answers 4

2

I was able to solve this by installing the package libtomcat7-Java. This appears to be the missing dependency.

sudo apt-get install libtomcat7-java 
0

I understand this problem. It is caused by (a) splitting Tomcat parts into different FS places (/etc, /var, /usr/lib, /usr/share etc) (b) assigning wrong ownership (=permissions) to e.g. logs and temp directory. Then user tomcat7 just can't even write its complaint on startup.

Simple solution is to install tgz from tomcat.apache.org (and start it manually; ok if you develop with tc). Another is just read startup script, learn what dirs are to be updated, check their ownership. Wasy hack is to add user tomcat7 to group root, that usually has write bits.

0
0

I also tried installation through binary method (tgz).After that tomcat is service is working fine and http://My_Ip:8080 is also working but when checked the /var/log/tomcat/ logs its showing some error,

 at
 org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1564)
 at java.util.concurrent.FutureTask.run(FutureTask.java:262) at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at java.lang.Thread.run(Thread.java:745)

 Dec 08, 2014 10:12:47 AM org.apache.coyote.AbstractProtocol stop INFO:
 Stopping ProtocolHandler ["http-bio-8080"] Dec 08, 2014 10:12:47 AM
 org.apache.coyote.AbstractProtocol destroy INFO: Destroying
 ProtocolHandler ["http-bio-8080"]
0

I had the same problem with tomcat8, and I was able to solve the problem by removing tomcat8-common:

sudo apt-get purge tomcat8-common

I hope this will help other people who have the same problem.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .