LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 10-09-2012, 02:58 AM   #1
Rafael25
Member
 
Registered: Jul 2012
Posts: 53

Rep: Reputation: Disabled
Unhappy 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
 
Old 10-10-2012, 06:11 AM   #2
pmvstrm
LQ Newbie
 
Registered: Sep 2012
Posts: 17

Rep: Reputation: Disabled
- 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.
 
Old 10-10-2012, 07:29 AM   #3
arun5002
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 549
Blog Entries: 5

Rep: Reputation: Disabled
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

Last edited by arun5002; 10-10-2012 at 07:30 AM.
 
Old 10-10-2012, 08:31 AM   #4
pmvstrm
LQ Newbie
 
Registered: Sep 2012
Posts: 17

Rep: Reputation: Disabled
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.
 
  


Reply

Tags
multiple, socket, tomcat


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Whether There is any tool for tomcat deployment arun5002 Linux - Server 1 11-21-2011 11:32 PM
[SOLVED] Tomcat administration webapps arvindk.monu Linux - Server 2 07-04-2010 11:12 AM
Tomcat Deployment Issues Tyler_H72 Linux - Server 5 10-09-2008 07:14 PM
Error in tomcat deployment chnlinux Linux - Newbie 1 08-22-2007 10:12 PM
Apache/tomcat/webapps: Invalid command 'WebAppDeploy' (and WebAppInfo) jeroenvrp Debian 2 10-18-2004 03:07 AM


All times are GMT -5. The time now is 01:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration