我有一个eclipse的问题,说端口已经在使用(80,8009),当我更改端口时收到错误:localhost上的Tomcat v6无法启动。
当我调试Tomcat时,我收到此错误:
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)
由于
答案 0 :(得分:5)
默认情况下,Tomcat使用两个端口:一个用于HTTP连接器,另一个用作“服务器”端口。如果您打开tomcat/conf/server.xml
,您将看到定义了这些端口:
<?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>
如您所见,端口8009用于AJP连接器,8080用于HTTP连接器。
您需要确保系统(另一个Tomcat或其他应用程序)不使用这三个端口,如果是,则需要将这些值更改为其他值。
答案 1 :(得分:4)
从以下链接下载TCP视图sw并解压缩。 http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx。在localport列中看到是否有任何进程在8080端口工作。右键单击并结束该过程。然后尝试启动TomCat服务器。它真的对我有用..
答案 2 :(得分:3)
通过运行
找出保留端口的应用程序netstat -no
netstat -anp
查找8005
或8080
上的8009
,127.0.0.1
,0.0.0.0
个端口。在任务管理器(Windows)或ps
(Linux)中查找PID(进程ID),找出它是什么程序,终止它,然后再次尝试启动Tomcat。
答案 3 :(得分:0)
此问题的实际原因是WINDOWS_INSTALLTION / windows / System32 / drivers / etc中显示的主机文件,其中您的旧IP地址映射到localhost,如下所示:
127.0.0.1 localhost
192.168.XXX.XX localhost
这第二行是罪魁祸首,有两种解决方法:
请参阅此博客以获取更多详细信息: http://mprabhat.wordpress.com/2012/11/05/tomcat-java-net-bindexception-cannot-assign-requested-address-jvm_bind/
答案 4 :(得分:0)
没有马戏团,
1.只需下载这个&#34; apr-1.5.1-win32-src.zip&#34;来自https://apr.apache.org/download.cgi
提取文件夹
将它放在Tomcat可以访问的文件夹中,在你的情况下(C:\ Users \ Rajin \ Desktop \ eclipse-jee-helios-SR1-win32 \ eclipse)。
< / LI>重新运行应用程序/重新启动服务器。