• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Multiple webapps deployment on tomcat  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Bartender
Posts: 20745
124
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Rafael!

You cannot have 2 identical instances of the Tomcat server running at the same time on the same machine. The TCP/IP architecture only allows one program to listen on any one port.

There is some confusion as to what you mean when you say "multiple webapps". A single copy of Tomcat can hold more than one webapp - there's no need to start a second Tomcat, if that's what you are doing.
 
Rafael Nathan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

Thanks for the quick reply.

I unpacked the webapp Apache roller in the webapps directory with the name roller1 and restarted tomcat. Yet again, I unpacked another copy of Apache roller in the webapps directory with the name roller2 and restarted tomcat.

However, tomcat crashes and I am left with nothing

Please help
 
Tim Holloway
Bartender
Posts: 20745
124
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rafael Nathan wrote:
However, tomcat crashes and I am left with nothing



No even a stack trace?
 
You firghten me terribly. I would like to go home now. Here, take this tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!