Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat error in eclipse

Tags:

eclipse

tomcat

I have a problem with eclipse that says the ports are already in use (80, 8009), When I change the ports I receive an error: Tomcat v6 at localhost failed to start.

When I debug Tomcat I receive this error:

11-Mar-2011 21:11:40 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\jdk1.6.0_21\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\Program Files\Java\jdk1.5.0_09\bin;C:\Program Files\QuickTime\QTSystem\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\apache-ant-1.8.1\bin;C:\Program Files\Subversion\bin;C:\Program Files\Java\jdk1.6.0_21\bin;C:\Users\Rajin\Desktop\eclipse-jee-helios-SR1-win32\eclipse;
11-Mar-2011 21:11:41 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:EducationGamesApp' did not find a matching property.
11-Mar-2011 21:11:41 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
11-Mar-2011 21:11:41 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 635 ms
11-Mar-2011 21:11:41 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
11-Mar-2011 21:11:41 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
11-Mar-2011 21:11:41 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
11-Mar-2011 21:11:41 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8008
11-Mar-2011 21:11:41 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/29  config=null
11-Mar-2011 21:11:41 org.apache.catalina.startup.Catalina start
INFO: Server startup in 390 ms
11-Mar-2011 21:11:41 org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[8005]: 
java.net.BindException: Address already in use: JVM_Bind
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:365)
    at java.net.ServerSocket.bind(ServerSocket.java:319)
    at java.net.ServerSocket.<init>(ServerSocket.java:185)
    at org.apache.catalina.core.StandardServer.await(StandardServer.java:373)
    at org.apache.catalina.startup.Catalina.await(Catalina.java:662)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:614)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Thanks

like image 369
Raj Avatar asked Mar 11 '11 21:03

Raj


People also ask

Why Tomcat is not working with Eclipse?

Most of the time, this means that Tomcat is already running in the background and Eclipse is trying to open it again on the same ports. This is obviously not possible, as the ports will be in use. The issue typically arises from either the Eclipse or Tomcat process crash or being stuck.

How do I fix Tomcat error?

This error indicates that the server could not find the desired resource. This resource can be any file such as JSP, HTML, or image resource. Usually, the resource is present, but it is referenced incorrectly. In most cases, you can fix this by correcting the URL.

What is a Tomcat error?

Out Of Memory Errors, or OOMEs, are one of the most common problems faced by Apache Tomcat users. Generally, these errors occur during development, but can even occur on production servers that are experiencing an unusually high spike of traffic.

How do I update Tomcat in Eclipse?

For configuring the tomcat server in eclipse IDE, click on servers tab at the bottom side of the IDE -> right click on blank area -> New -> Servers -> choose tomcat then its version -> next -> click on Browse button -> select the apache tomcat root folder previous to bin -> next -> addAll -> Finish.


2 Answers

By default, Tomcat is using two ports: one for HTTP connector and one as "Server" port. If you open tomcat/conf/server.xml, you will see these ports defined:

<?xml version='1.0' encoding='utf-8'?>
  <Server port="8005" shutdown="SHUTDOWN">
  ...
  <Service name="Catalina">
    <Connector port="8080" protocol="HTTP/1.1" ...
    ...
    <Connector port="8009" protocol="AJP/1.3" ...
  </Service>
</Server>

As you can see, port 8009 is used for AJP connector and 8080 for HTTP connector.

You need to ensure none of these three ports are being used by your system (another Tomcat or just another application) and if they are, you need to change these values to something else.

like image 161
mindas Avatar answered Oct 17 '22 13:10

mindas


download TCP view sw from the following link and unzip it. http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx. see in the localport column is there any process worked in 8080 port . right click and end the process. then try to start the TomCat server. its really worked for me..

like image 28
PRATHIP Avatar answered Oct 17 '22 13:10

PRATHIP