LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Multiple webapps deployment on tomcat (http://www.linuxquestions.org/questions/linux-software-2/multiple-webapps-deployment-on-tomcat-4175431266/)

Rafael25 10-09-2012 02:58 AM

Multiple webapps deployment on tomcat
 
Hi,

I have setup Apache Tomcat on my CentOS machine and it seems to work as a charm initially and a service tomcat start leaves me with output as such
Using CATALINA_BASE: /usr/share/apache-tomcat
Using CATALINA_HOME: /usr/share/apache-tomcat
Using CATALINA_TMPDIR: /usr/share/apache-tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/share/apache-tomcat/bin/bootstrap.jar:/usr/share/apache-tomcat/bin/tomcat-juli.jar

Further, I deployed the apache roller webapp and it works well and as soon as I deploy another instance of Apache roller the container crashes I wonder why ?
A restart now leaves me with this :
Using CATALINA_BASE: /usr/share/apache-tomcat
Using CATALINA_HOME: /usr/share/apache-tomcat
Using CATALINA_TMPDIR: /usr/share/apache-tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/share/apache-tomcat/bin/bootstrap.jar:/usr/share/apache-tomcat/bin/tomcat-juli.jar
Oct 09, 2012 6:40:05 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:337)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:198)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:490)
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:601)
at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:371)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:453)

Using CATALINA_BASE: /usr/share/apache-tomcat
Using CATALINA_HOME: /usr/share/apache-tomcat
Using CATALINA_TMPDIR: /usr/share/apache-tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/share/apache-tomcat/bin/bootstrap.jar:/usr/share/apache-tomcat/bin/tomcat-juli.jar

I am unable to deploy more than one webapp

Here is my /etc/init.d/tomcat script
#!/bin/bash
# description: Tomcat Start Stop Restart
# processname: tomcat
# chkconfig: 234 20 80
JAVA_HOME=/usr/java/jdk1.7.0_01
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/usr/share/apache-tomcat
RETVAL=0

status() {
SHUTDOWN_PORT=$(netstat -vtnl|grep 8005|wc -l)
if [ $SHUTDOWN_PORT -eq 0 ]; then
echo "tomcat is not running..."
RETVAL=1
exit $RETVAL
else
echo "tomcat is running..."
RETVAL=0
exit $RETVAL
fi
}

case $1 in
start)
su - admin -c $CATALINA_HOME/bin/startup.sh
;;
stop)
su - admin -c $CATALINA_HOME/bin/shutdown.sh
;;
restart)
su - admin -c $CATALINA_HOME/bin/shutdown.sh
su - admin -c $CATALINA_HOME/bin/startup.sh
;;
status)
status
;;
*)
echo $"Usage: tomcat {start|stop|restart|status}"
exit 1
esac

exit $RETVAL


Please help. Need to get it working badly

Thanks in advance.

Best Regards,
Rafael Nathan

pmvstrm 10-10-2012 06:11 AM

- Check if Port is allready in use
- Check your startup script has bind permissions on lower ports.

- If nothing works, try killall java and start tomcat again.

arun5002 10-10-2012 07:29 AM

Hi

Look after the following parameter

1.Differ the serverport,connectorport,redirectport in server.xml .
2.Clean the works folder and try to start the application

pmvstrm 10-10-2012 08:31 AM

Check thadt the Param Autobind is set to yes. It depends on your Linux Version.
On Debian it is the file /etc/default/tomcat and restart tomcat.


All times are GMT -5. The time now is 01:40 AM.