java - 无法在 Tomcat 8.0.2 上的 Netbeans 中部署我的 Web 应用程序(出现以下错误)

标签 java tomcat netbeans

我已经阅读了很多关于这个问题的帖子,但没有一个解决方案对我有用。 我正在疯狂地尝试解决这个问题。我的 Web 应用程序运行良好,几天前我在尝试运行该应用程序时开始收到以下异常 或者只是启动 Tomcat(来自 Netbeans)。有时(很少),Tomcat 确实启动了,但 Netbeans8.1 仍然无法部署应用程序(部署错误:启动 Tomcat 失败)。

 28-Jan-2016 15:32:17.947 SEVERE [main]  

org.apache.coyote.AbstractProtocol.init Failed to initialize end point associated with ProtocolHandler ["ajp-apr-8009"]
 java.lang.Exception: Socket bind failed: [730048] Only one usage of each socket address (protocol/network address/port) is normally permitted.  
    at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:471)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:742)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:457)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:960)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:567)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:851)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:576)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:599)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)

28-Jan-2016 15:32:17.947 SEVERE [main] org.apache.catalina.core.StandardService.initInternal Failed to initialize connector [Connector[AJP/1.3-8009]]
 org.apache.catalina.LifecycleException: Failed to initialize component [Connector[AJP/1.3-8010]]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:567)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:851)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:576)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:599)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)
...

我应该说我的同事有相同的 Tomcat 配置和版本,但问题只存在于我的 PC 上。无论如何,这是 server.xml 的一部分

<Connector connectionTimeout="20000" port="8081" protocol="HTTP/1.1" redirectPort="8443"/>
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
           port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />
-->
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
     This connector uses the NIO implementation that requires the JSSE
     style configuration. When using the APR/native implementation, the
     OpenSSL style configuration is required as described in the APR/native
     documentation -->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
           maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" />
-->

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>

据我所知(我使用过 netstat -aon),没有其他进程正在使用该端口 (8009),我尝试了其他端口但无济于事。

谢谢

最佳答案

似乎8009端口正在使用一些地方

请在窗口中使用以下命令检查您的端口是否正在运行

netstat -aon | findstr 8009

如果你发现任何正在使用的进程,就终止进程

taskkill /pid <pid>

关于java - 无法在 Tomcat 8.0.2 上的 Netbeans 中部署我的 Web 应用程序(出现以下错误),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35064768/

相关文章:

java - <class> 的类型是 netbeans 中的错误错误

Java 和八进制数

java - 以编程方式运行 ant : "Cannot use SUN rmic"

java - 我的 SOA 项目使用哪些工具?

tomcat - tomcat 引导加载程序的 native 库

tomcat - 在go中解析tomcat日志文件的时间戳

java - 如何在我的 web 项目中配置 log4J

javascript - 如何在 NetBeans 的 JSDoc 注释中转义 @ 符号

java - 没有 bytearrayinputstream 的 java 中的字符串流

netbeans - 无法使用 Netbeans 添加 NPM 库