# Tomcat doesn't start

## romeo

I have emerged tomcat and when I try to start it from the init.d folder, I get the following error:

kmp init.d # ./tomcat start

 * Starting Tomcat...

/opt/tomcat/bin/catalina.sh: line 63: /etc/conf.d/tomcat: Permission den  [ !! ]

etc/conf.d/tomcat permission is 750 according to the newest install and security warning (by default, haven't changed it).

When I run catalina from the /opt/tomcat/bin/ folder it runs fine. What can I try to solve this problem?

----------

## SmegTheLight

That bug was for /opt/tomcat - Not /etc/conf.d/tomcat

/etc/conf.d/tomcat needs to be mode 755

(Default is uid=root, gid=root, mode 755)

or

/etc/conf.d/tomcat needs to be set to group "tomcat" and mode 750

(which is what I have done with mine)

----------

## romeo

Thanks, setting the group to tomcat worked!

Is there a difference between setting the user to tomcat or leaving it as root?

For now I only changed the group and not the user, so now it is "root:tomcat".

But what happens when I set it to "tomcat:tomcat". 

Which one is preferred and why?

----------

## SmegTheLight

 *romeo wrote:*   

> Thanks, setting the group to tomcat worked!
> 
> Is there a difference between setting the user to tomcat or leaving it as root?
> 
> For now I only changed the group and not the user, so now it is "root:tomcat".
> ...

 

Shouldn't make a difference - as long as the tomcat startup script (running as tomcat) can read the file, everything should be fine.

I have mine as root:tomcat and mode 750 so only root can modifiy it.  I feel it is more secure, as only root can mess with the file, and tomcat only gets what it needs - read and execute access.

----------

## dantrevino

My tomcat wont start either. 

```
chaos bin # /etc/init.d/tomcat start

 * Starting Tomcat...                                                     [ !! ] 

chaos bin #

```

4.1.24 was working fine.   When I updated I got a message saying user and group "Tomcat" were created but they werent.  I created them, but still no love.  I'm not seeing any errors in /var/log/tomcat.  I dont have anything else using port 8080.  Any ideas?

----------

## rt_clik

I have the exact same issue on my Intel box. I've got a PPC box running the same 4.1.24-r1 version fine...only difference between the two is the version of the blackdown-jdk. On my PPC it is 1.3.1. On my Intel box it is 1.4.1. I have not been able to discern any other differences between the two.

No solution yet...just validation. Anyone else?

 *dantrevino wrote:*   

> My tomcat wont start either. 
> 
> ```
> chaos bin # /etc/init.d/tomcat start
> 
> ...

 

----------

## dlblinux

I was having the same errors.

I am pretty new at this, but I just got tomcat working by:

looking at the passwd file in the /etc, I noticed that the groups listed for the tomcat entry were

Apache Tomcat

Note the uppercase on both groups.  I did not see any groups listed as uppercase in my group file so I changed my these to lowercase in the passwd file, and tomcat comes up fine now.

----------

## rt_clik

Actually, you are mistaken. The "Apache Tomcat" is in the comment field. The primary group is specified by the GID in the /etc/passwd file. Additonal groups (of which there are none by default for the tomcat user) are defined in /etc/group.

I unmerged and re-emerged tomcat. Now, I get an [ok] indicator on the /etc/init.d/tomcat start command, but my /var/log/tomcat/catalina.log file looks like this: 

```
java.util.zip.ZipException: No such file or directory

        at java.util.zip.ZipFile.open(Native Method)

        at java.util.zip.ZipFile.<init>(ZipFile.java:112)

        at java.util.jar.JarFile.<init>(JarFile.java:117)

        at java.util.jar.JarFile.<init>(JarFile.java:55)

        at org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(StandardClassLoader.java:1082)

        at org.apache.catalina.loader.StandardClassLoader.<init>(StandardClassLoader.java:221)

        at org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:204)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:147)

Bootstrap: Class loader creation threw exception

java.lang.IllegalArgumentException: addRepositoryInternal: java.util.zip.ZipException: No such file or directory

        at org.apache.catalina.loader.StandardClassLoader.addRepositoryInternal(StandardClassLoader.java:1110)

        at org.apache.catalina.loader.StandardClassLoader.<init>(StandardClassLoader.java:221)

        at org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:204)

        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:147)

```

Appears to be a CLASSPATH error, but I cannot locate it in the config. Tomcat is definitely not running.

Earlier I had speculated that it might be a Java version problem, but I have dismissed that since downloading and installing ibm-jdk-1.4.1 on my PPC machine where Tomcat has been working under 1.3.1. Tomcat continues to work with the new JDK, leading me to search for other clues as to the problems on my x86 box.

 *dlblinux wrote:*   

> I was having the same errors.
> 
> I am pretty new at this, but I just got tomcat working by:
> 
> looking at the passwd file in the /etc, I noticed that the groups listed for the tomcat entry were
> ...

 

----------

## svyatogor

 *romeo wrote:*   

> 
> 
> kmp init.d # ./tomcat start
> 
>  * Starting Tomcat...
> ...

 

The permisions should be 644, this is a bug in the ebuild. Should be fixed now.

----------

## zanymac

 *rt_clik wrote:*   

> I have the exact same issue on my Intel box. I've got a PPC box running the same 4.1.24-r1 version fine...only difference between the two is the version of the blackdown-jdk. On my PPC it is 1.3.1. On my Intel box it is 1.4.1. I have not been able to discern any other differences between the two.
> 
> No solution yet...just validation. Anyone else?
> 
>  *dantrevino wrote:*   My tomcat wont start either. 
> ...

 

I've been looking through this thread, cause I just emerged tomcat a few minutes ago and have had similar issues.  Here's what I found on my box:

The permissions were set wrong, so I chown'ed -R to root:tomcat /opt/tomcat, /var/log/tomcat, /etc/conf.d/tomcat.  I noticed that tomcat appeared to come up when I typed /etc/init.d/tomcat start, but when I tried to go to http://localhost:8080, I got a connection refused.  I then typed /etc/init.d/tomcat stop, I then got a bunch of java.net.Connect errors.  I then tried to start tomcat manually.  I checked to see if the variable was set up, it wasn't on my box, so I set it: export CATALINA_HOME=/opt/tomcat/bin.  I then cd'ed to $CATALINA_HOME

and typed ./startup.sh.  It started up fine.  I'm not sure if the startup script in /etc/conf.d is set up correctly.  Let me know if this works for any of you.

Cheers,

Bastian

----------

## professorn

It works perfecly on my box, tomcat + SUn Java

----------

## rt_clik

I resolved this on my x86 box a few weeks ago, but it was during the time that the Forums site wasn't taking posts (some glitch, I guess). Was a combination of the chmod fix and emerge unmerge tomcat && emerge tomcat.

Works fine now for both platforms.

CW

----------

