Tomcat not running on Amazon EC2, Redhat Instance - java

I'm a java application developer, and don't know much about linux configuration.
I'm trying to install Java and Tomcat to a fresh Redhat instance on Amazon EC2, and executed the below script.
mkdir /usr/local/java
cd /usr/local/java
curl http://download.oracle.com/otn-pub/java/jdk/7u2-b13/jdk-7u2-linux-i586.rpm > jdk.rpm
rpm -iv jdk.rpm
updatedb; locate javac | grep bin # this step merely serves to verify the installation
/usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_02/bin/java 100
/usr/sbin/alternatives --install /usr/bin/jar jar /usr/java/jdk1.7.0_02/bin/jar 100
/usr/sbin/alternatives --install /usr/bin/javac javac /usr/java/jdk1.7.0_02/bin/javac 100
/usr/sbin/alternatives --config java
updatedb
mkdir /env
mkdir /env/tomcat
cd /env/tomcat
curl http://www.gtlib.gatech.edu/pub/apache/tomcat/tomcat-7/v7.0.23/bin/apache-tomcat-7.0.23.tar.gz > apache-tomcat-7.0.23.tar.gz
tar zxvf apache-tomcat-7.0.23.tar.gz
cd apache-tomcat-7.0.23
bin/startup.sh #
At this point, http://ec2-23-20-24-96.compute-1.amazonaws.com:8080/ was expected to return Tomcat homepage, but it didn't :(
cd /etc/rc.d/init.d/
vi tomcat
I pasted the below content to the file:
#!/bin/sh
# Tomcat init script for Linux.
#
# chkconfig: 2345 96 14
# description: The Apache Tomcat servlet/JSP container.
JAVA_HOME=/usr/java/jdk1.7.0_02
CATALINA_HOME=/env/tomcat/apache-tomcat-7.0.23
export JAVA_HOME CATALINA_HOME
exec $CATALINA_HOME/bin/catalina.sh $*
Then executed:
chmod 755 /etc/rc.d/init.d/tomcat
chkconfig --level 2345 tomcat on
export JAVA_HOME=/usr/java/jdk1.7.0_02
export PATH=$PATH:/usr/java/jdk1.7.0_02
export CATALINA_HOME=/env/tomcat/apache-tomcat-7.0.23
/env/tomcat/apache-tomcat-7.0.23/bin/shutdown.sh
/env/tomcat/apache-tomcat-7.0.23/bin/startup.sh
Nowhere did I get any error, but I also couldn't get the Tomcat homepage to display.
Can you guide where where I went wrong.
Thanks
James
EDIT:
Tomcat log (on stopping and starting server)
Jan 18, 2012 2:06:48 AM org.apache.catalina.core.StandardServer await
INFO: A valid shutdown command was received via the shutdown port. Stopping the Server instance.
Jan 18, 2012 2:06:48 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Jan 18, 2012 2:06:48 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Jan 18, 2012 2:06:48 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Jan 18, 2012 2:06:48 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Jan 18, 2012 2:06:48 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Jan 18, 2012 2:06:48 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Jan 18, 2012 2:06:48 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
Jan 18, 2012 2:08:46 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/java/packages/lib/i386:/lib:/usr/lib
Jan 18, 2012 2:08:46 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jan 18, 2012 2:08:46 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 18, 2012 2:08:46 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 530 ms
Jan 18, 2012 2:08:46 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jan 18, 2012 2:08:46 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.23
Jan 18, 2012 2:08:46 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /env/tomcat/apache-tomcat-7.0.23/webapps/examples
Jan 18, 2012 2:08:47 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /env/tomcat/apache-tomcat-7.0.23/webapps/host-manager
Jan 18, 2012 2:08:47 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /env/tomcat/apache-tomcat-7.0.23/webapps/manager
Jan 18, 2012 2:08:47 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /env/tomcat/apache-tomcat-7.0.23/webapps/docs
Jan 18, 2012 2:08:47 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /env/tomcat/apache-tomcat-7.0.23/webapps/ROOT
Jan 18, 2012 2:08:47 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jan 18, 2012 2:08:47 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 18, 2012 2:08:47 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 583 ms
EDIT2:
My problem looks similar to the one on https://forums.aws.amazon.com/thread.jspa?threadID=59937, but that provides no solution.
I performed a wget, and I received a proper index.html with Tomcat homepage html.
wget http://ec2-23-20-24-96.compute-1.amazonaws.com:8080
I have two security groups - default and quick-start-1, and I've added ports 80 and 8080 to the list.

Solved it with help from AWS Support:
Hello
It initially looks like iptables is running on your instance, my checks show filtered ports, you will need to add a rule to allow port 8080, or disable the firewall on the instance itself.
You can verify this by running as root "service iptables stop" and then see if you can connect on port 8080.
Kind Regards
AndyC
Link: https://forums.aws.amazon.com/thread.jspa?messageID=312167&#312167

Related

Changing Server Settings and Adding New Files Are Not Detected in Tomcat

I was trying to learn how to use servlet by following the tutorial in this page:
https://www.ntu.edu.sg/home/ehchua/programming/howto/Tomcat_HowTo.html
When I reached 2.6 STEP 5: Develop and Deploy a WebApp, I was told to restart tomcat so that it'll load the directory I just made. However, the changes I made was not loaded, the assigned port is still 8080 even though I assigned it to 9999 and the hello directory was not found. Here are the messages when I issued startup.bat:
Apr 26, 2019 5:32:04 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.2.21 using APR version 1.6.5.
Apr 26, 2019 5:32:04 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Apr 26, 2019 5:32:04 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.1.1a 20 Nov 2018)
Apr 26, 2019 5:32:04 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
Apr 26, 2019 5:32:04 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Apr 26, 2019 5:32:04 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 494 ms
Apr 26, 2019 5:32:04 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 26, 2019 5:32:04 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Apr 26, 2019 5:32:04 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory G:\Tomcat 2\webapps\docs
Apr 26, 2019 5:32:05 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [146] milliseconds.
Apr 26, 2019 5:32:05 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory G:\Tomcat 2\webapps\examples
Apr 26, 2019 5:32:05 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory G:\Tomcat 2\webapps\host-manager
Apr 26, 2019 5:32:05 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory G:\Tomcat 2\webapps\manager
Apr 26, 2019 5:32:05 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory G:\Tomcat 2\webapps\ROOT
Apr 26, 2019 5:32:05 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Apr 26, 2019 5:32:05 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Apr 26, 2019 5:32:05 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1092 ms
As you can see, the hello directory was not deployed. So, what is exactly happening here?
I just realized that when I issued the startup & shutdown command that there was an information in the console which looked like this:
Using CLASSPATH: "G:\Learning\tomcat9\bin\bootstrap.jar;G:\Learning\tomcat9\bin\tomcat-juli.jar"
It seemed that my classpath was pointing to the wrong path. I deleted CATALINA_HOME in the environment variable settings, and now it is working fine.

IntelliJ IDEA 14.1 slow to launch Tomcat 7 EE web application

Mac OSX 10.9.5 / Tomcat 7.0.62/ java version "1.8.0_45"/ IDEA 14.1.3
I'm experiencing some odd behavior getting IDEA to launch an exploded war to Tomcat as a local Tomcat server configuration.
By itself, Tomcat starts immediately if I run its scripts (i.e., startup.sh or catalina.sh start | run) and the webapp is accessible from a browser. Command line apps run immediately in IDEA. The problem is just when I run a web application from inside IDEA, trying to deploy the exploded app to Tomcat local. Changing the browser in the configuration has no effect.
When I hit "run" there's nothing in the output window for about 5 minutes. Then the web app actually runs, and the following output shows in the IDEA output window:
/usr/local/tomcat7/bin/catalina.sh run
[2015-06-05 09:35:24,040] Artifact thought_test:war exploded: Server is not connected. Deploy is not available.
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.62
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: May 7 2015 17:14:55 UTC
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.62.0
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Mac OS X
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 10.9.5
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: x86_64
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_45-b14
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /Users/magneto/Library/Caches/IntelliJIdea14/tomcat/Unnamed_thought_test
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /usr/local/tomcat7
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.config.file=/Users/magneto/Library/Caches/IntelliJIdea14/tomcat/Unnamed_thought_test/conf/logging.properties
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcom.sun.management.jmxremote=
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcom.sun.management.jmxremote.port=1099
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcom.sun.management.jmxremote.ssl=false
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.rmi.server.hostname=127.0.0.1
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/usr/local/tomcat7/endorsed
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/Users/magneto/Library/Caches/IntelliJIdea14/tomcat/Unnamed_thought_test
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/usr/local/tomcat7
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/usr/local/tomcat7/temp
Jun 05, 2015 9:35:25 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/magneto/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Jun 05, 2015 9:35:25 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jun 05, 2015 9:35:25 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 836 ms
Jun 05, 2015 9:35:25 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jun 05, 2015 9:35:25 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.62
Jun 05, 2015 9:35:25 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jun 05, 2015 9:35:25 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jun 05, 2015 9:35:25 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 118 ms
Connected to server
[2015-06-05 09:35:25,673] Artifact thought_test:war exploded: Artifact is being deployed, please wait...
[2015-06-05 09:35:26,203] Artifact thought_test:war exploded: Artifact is deployed successfully
[2015-06-05 09:35:26,204] Artifact thought_test:war exploded: Deploy took 531 milliseconds
Jun 05, 2015 9:35:35 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/local/tomcat7/webapps/manager
Jun 05, 2015 9:35:35 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /usr/local/tomcat7/webapps/manager has finished in 104 ms
There's been a few posts about the line:
Artifact thought_test:war exploded: Server is not connected. Deploy is not available.
But none of the given solutions work. I can't see anything that's going on that looks like it's using a lot of resources, that would cause the delay. It's really odd because after the delay, the connection to the server works, even though initially it didn't.
Update:
I tracked it down to the firewall. In 'Security & Privacy' -> 'Firewall' -> 'Firewall Options...' I unchecked 'Enable stealth mode'. After I did that the app started right up in IDEA and the browser (Chrome). Note that I first added both IDEA and Chrome to the firewall's list of applications that 'Allow incoming connections' but that didn't matter.
I'd mark it as a solution, but I rather know why there's something in the Mac OS firewall that's treating the connection from IDEA to Tomcat as Ping or ICMP and blocking it for a few minutes.
You need to increase your memory parameter.
Just go Run / Debug configuration and set is as in picture.Hope it will work better than previous
You might turn on the method breakpoints , find them and turn them off.
See also this so: Intellij Debugger slow: Method breakpoints my dramatically slow down debugging
and also this official article: https://intellij-support.jetbrains.com/hc/en-us/articles/206544799-Java-slow-performance-or-hangups-when-starting-debugger-and-stepping
If you're using Tomcat plugin then make sure that in Tomcat Server configuration "Before Launch" doesn't contain the 'Build:artifcat' option as that's what makes it run every time even when you've done clean install.

open shift war deployment error

getting below error when deploying war to openshift using git command..i was able to deploy correctly earlier but not sure what happened and now not able to deploy and getting this error..in local i am able to run the same wat correctly.
Sep 25, 2014 12:59:53 PM org.apache.catalina.startup.Catalina addClusterRuleSet
INFO: Cluster RuleSet not found due to [java.lang.ClassNotFoundException: org.apache.catalina.ha.ClusterRuleSet]. Cluster configuration disabled.
Sep 25, 2014 12:59:53 PM org.apache.catalina.startup.Catalina addClusterRuleSetINFO: Cluster RuleSet not found due to [java.lang.ClassNotFoundException: org.ap
ache.catalina.ha.ClusterRuleSet]. Cluster configuration disabled.
Sep 25, 2014 12:59:54 PM 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: /opt/rh/mysql55/root/usr/lib64:/usr/java/packages/lib/i386:/lib:/usr/lib
Sep 25, 2014 12:59:55 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-127.3.114.129-8080"]
Sep 25, 2014 12:59:55 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2841 ms
Sep 25, 2014 12:59:56 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 25, 2014 12:59:56 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.54
Sep 25, 2014 12:59:56 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/openshift/53579b125004465e18000995/app-root/runtime/dependencies/jbossews/webapps/abc.war
Sep 25, 2014 1:00:56 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Sep 25, 2014 1:00:56 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
Sep 25, 2014 1:00:56 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /var/lib/openshift/53579b125004465e18000995/app-root/runtime/dependencies/jbossews/webapps/ROOT.war has finished in
8,534 ms
Sep 25, 2014 1:00:56 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-127.3.114.129-8080"]
Sep 25, 2014 1:00:56 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 60436 ms
Looks like an exception is being thrown from your application. Is this the catalina.out log? How are you deploying the application (via IDE or?).

Tomcat 7 doesn't shut down, process keeps running?

I started tomcat 7 using,
cd /opt/tomcat7/bin
$/opt/tomcat7/bin ./startup.sh
It shows process running
root 23206 130 3.4 1323956 572880 pts/2 Sl 07:58 1:05 /usr/bin/java -Djava.util.logging.config.file=/opt/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dspring.profiles.active=mongo1,maxListenersAllowed -DST_SERVER=mongo1 -Djava.endorsed.dirs=/opt/tomcat7/endorsed -classpath /opt/tomcat7/bin/bootstrap.jar:/opt/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/opt/tomcat7 -Dcatalina.home=/opt/tomcat7 -Djava.io.tmpdir=/opt/tomcat7/temp org.apache.catalina.startup.Bootstrap start
If I shutdown it using
$/opt/tomcat7/bin ./shutdown.sh
It gives this message
Using CATALINA_BASE: /opt/tomcat7
Using CATALINA_HOME: /opt/tomcat7
Using CATALINA_TMPDIR: /opt/tomcat7/temp
Using JRE_HOME: /usr
Using CLASSPATH: /opt/tomcat7/bin/bootstrap.jar:/opt/tomcat7/bin/tomcat-juli.jar
but if I check the above process, it still shows it running. Tomcat doesn't shut down. I tried it using root user as well but still no success.
Manully I can kill the process but I want to create deploy script so want to do it using shutdown.sh and startup.sh
Same happens if I try using
/opt/tomcat7/bin/catalina.sh start
/opt/tomcat7/bin/catalina.sh stop
Log
Jul 23, 2014 8:26:17 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/java/packages/lib/i386:/lib:/usr/lib
Jul 23, 2014 8:26:18 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8081"]
Jul 23, 2014 8:26:18 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jul 23, 2014 8:26:18 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 361 ms
Jul 23, 2014 8:26:18 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 23, 2014 8:26:18 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.53
Jul 23, 2014 8:26:18 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/tomcat7/webapps/docs
Jul 23, 2014 8:26:18 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/tomcat7/webapps/manager
Jul 23, 2014 8:26:18 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/tomcat7/webapps/ROOT
Jul 23, 2014 8:26:18 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/tomcat7/webapps/examples
Jul 23, 2014 8:26:18 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/tomcat7/webapps/host-manager
Jul 23, 2014 8:26:18 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/tomcat7/webapps/target
Jul 23, 2014 8:26:18 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8081"]
Jul 23, 2014 8:26:18 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jul 23, 2014 8:26:18 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 862 ms
Jul 23, 2014 8:26:42 AM org.apache.catalina.core.StandardServer await
INFO: A valid shutdown command was received via the shutdown port. Stopping the Server instance.
Jul 23, 2014 8:26:42 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8081"]
Jul 23, 2014 8:26:42 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Jul 23, 2014 8:26:42 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Jul 23, 2014 8:26:42 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8081"]
Jul 23, 2014 8:26:42 AM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Jul 23, 2014 8:26:42 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8081"]
Jul 23, 2014 8:26:42 AM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
You can force the shutdown by PID.
Edit
..tomcat/bin/catalina.sh
and set the
CATALINA_PID=path
variable to a local path.
CATALINA_PID
(Optional) Path of the file which should contains the pid of the
catalina startup java process, when start (fork) is used
then you can shutdown Tomcat with -force flag
../tomcat/bin/shutdown.sh -force
If the script can not stop Tomcat normally will use a kill to stop the process by PID.
Update:
According to Joshua Taylor comment, the recommended way to store additional variables for running tomcat is the setenv.* script.
Take a look at (3.4) Using the "setenv" script (optional, recommended) section in the tomcat running docs
https://tomcat.apache.org/tomcat-7.0-doc/RUNNING.txt
If you are in windows, and using the portable tomcat, you can use the nircmd program tool, and close by title console window, instead of stopping by PID.
When you have downloaded this tool, just do:
nircmd.exe win close title "Tomcat"
I once had the misfortune of a page running infinite redirect loops due to a faulty authentication mechanism.
It eventually slowed down the entire server, but also made it impossible for me to shut it down gracefully. In the end I had to employ brute force like vzamanillo describes.
The point being that something fishy might be running within your server's processes that won't finish properly.
Is you shutdown port set? (in /etc/tomcat9/conf/server.xml )
<Server port="9005" shutdown="SHUTDOWN">

eclipse EE juno: java.net.bind exception

i am a newbie and just started to work in jsp, i installed the pre-requisites and created a Dynamic Web Project in Eclipse Juno, and to test if the configuration is working well, i have created a dummy jsp page named index.jsp and tried to run it. but i am getting error, the details are below:
Jun 26, 2013 5:20:24 PM 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: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Ruby200-x64\bin;C:\Python33\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin;C:\Program Files\Java\jdk1.7.0_21\bin;C:\Program Files\Java\jdk1.7.0_21\lib;C:\Program Files (x86)\Windows Live\Shared;.
Jun 26, 2013 5:20:24 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:DemoWebApp1' did not find a matching property.
Jun 26, 2013 5:20:24 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jun 26, 2013 5:20:24 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jun 26, 2013 5:20:24 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 755 ms
Jun 26, 2013 5:20:24 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jun 26, 2013 5:20:24 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.32
Jun 26, 2013 5:20:24 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jun 26, 2013 5:20:24 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jun 26, 2013 5:20:24 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 489 ms
Jun 26, 2013 5:20:24 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]:
java.net.BindException: Address already in use: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:427)
at org.apache.catalina.startup.Catalina.await(Catalina.java:766)
at org.apache.catalina.startup.Catalina.start(Catalina.java:712)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:451)
Jun 26, 2013 5:20:24 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Jun 26, 2013 5:20:26 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Jun 26, 2013 5:20:27 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Jun 26, 2013 5:20:27 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Jun 26, 2013 5:20:28 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Jun 26, 2013 5:20:30 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Jun 26, 2013 5:20:30 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
i cannot figure out what am i doing wrong, or what is NOT properly configured in my system.
thanx in advance :)
i really want to start learning JSP as soon as possible, but this is stopping me. HELP!!
first you should try to uninstall tomcat and re-install it again by giving proper privileges. it should work for you. it worked for me.
re-install the eclipse, and tomcat with root privileges and re-configure the IDE.
You have another process running already which occupies port 8005.
This typically happens for 8005 when you try to start Tomcat, and it has been started already. Either by you elsewhere (another Eclipse debug session) or by having started Tomcat as a service when installing Tomcat.
By general principle you should not use an installer to get Tomcat up and running when wanting to run it from inside Eclipse, but a zip file.
If you are brand new to Java programming, I would suggest Netbeans instead (after uninstalling Tomcat). Their download generally works better out of the box for web development.
You should use tcpview from www.sysinternals.com to find out which process occupies port 8005. If you cannot get rid of that process, you may try to configure an alternate port in Tomcats server.xml
The port is already being used. You can do a quick check by changing the port here in this file %CATALINA_HOME%\conf\server.xml
and running the program again.

Categories