1

I am new to linux and I have installed java and tomcat6 on centos 5.6 using yum.

link I have used to install

I have also installed php, mysql and apcahe in my system.

apache port 80
mysql port 3306
tomcat port 8080

All of them are in running state. Now when I start my tomcat service, is it stating successfully but I am getting the following error message in catalina.out:

[root@centos5 tomcat6]# /sbin/service tomcat6 restart
Stopping tomcat6:                                          [  OK  ]
Starting tomcat6:                                          [  OK  ]

[root@centos5 tomcat6]# cat /var/log/tomcat6/catalina.out
/sbin/runuser: warning: cannot change directory to /usr/share/tomcat5: No such file or directory
Mar 19, 2013 8:17:21 AM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Mar 19, 2013 8:17:21 AM org.apache.catalina.connector.Connector pause
SEVERE: Protocol handler pause failed
java.net.UnknownHostException: centos5: centos5
    at java.net.InetAddress.getLocalHost(InetAddress.java:1426)
    at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:490)
    at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:288)
    at org.apache.jk.server.JkMain.pause(JkMain.java:739)
    at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:153)
    at org.apache.catalina.connector.Connector.pause(Connector.java:1138)
    at org.apache.catalina.core.StandardService.stop(StandardService.java:578)
    at org.apache.catalina.core.StandardServer.stop(StandardServer.java:788)
    at org.apache.catalina.startup.Catalina.stop(Catalina.java:662)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Mar 19, 2013 8:17:22 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Mar 19, 2013 8:17:22 AM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
/sbin/runuser: warning: cannot change directory to /usr/share/tomcat5: No such file or directory
Mar 19, 2013 8:17:23 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
Mar 19, 2013 8:17:23 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Mar 19, 2013 8:17:23 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 530 ms
Mar 19, 2013 8:17:24 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Mar 19, 2013 8:17:24 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.36
Mar 19, 2013 8:17:24 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
Mar 19, 2013 8:17:24 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
Mar 19, 2013 8:17:24 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
Mar 19, 2013 8:17:24 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Mar 19, 2013 8:17:24 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory sample
Mar 19, 2013 8:17:24 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Mar 19, 2013 8:17:24 AM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Mar 19, 2013 8:17:24 AM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/19  config=null
Mar 19, 2013 8:17:24 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 625 ms

Can anyone help me in resolving the issue?

1
  • Sorry. This is not a programming question, so it is off topic.
    – Stephen C
    Commented Mar 19, 2013 at 12:59

1 Answer 1

0

UnknownHostException means that host with name centos5 can not be found (see this nice answer). Therefore, open your /etc/hosts file, find the line that contains localhost, e.g.:

127.0.0.1 localhost 

and append centos5 to it like this:

127.0.0.1 localhost centos5

It should solve the problem, please feedback.

UPDATE: I just saw the first line:

[root@centos5 tomcat6]# /sbin/service tomcat6 restart

/sbin/runuser: warning: cannot change directory to /usr/share/tomcat5: No such file or directory

You are starting a service named tomcat 6 but the output states that it cannot find the tomcat 5 directory (default for CentOS as I understand from the link). It looks like your tomcat is not installed correctly so I'd recommend reinstallation.

But before that try running it like this:

/etc/init.d/tomcat6 start

If it still doesn't work, uninstall both 5 and 6:

yum remove tomcat5
yum remove tomcat6

and reinstall the tomcat6 again.

1
  • this what i had previously 127.0.0.1 dh-empbridge localhost.localdomain localhost and i have cahged it to 127.0.0.1 dh-empbridge localhost.localdomain localhost centos5, but no luck Commented Mar 20, 2013 at 7:08

You must log in to answer this question.

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