dsp_user
dsp_user

Reputation: 2119

Can't deploy my web application in Netbeans on Tomcat 8.0.2 (getting below error)

I have read many threads regarding this issue but none of the solutions worked for me. I'm going crazy trying to troubleshoot this. My web application worked well and then a couple of days ago I started receiving the following exception when either trying to run the application or just starting Tomcat (from Netbeans). Sometimes (rarely) , Tomcat does start but Netbeans8.1 still can't deploy the application (Deployement error: Starting of Tomcat failed ).

 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)
...

I should say that my colleagues have the same Tomcat configuration and version but the problem exists on my PC only. Anyway, here's part of 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"/>

As far as I can tell (I've used netstat -aon) , no other process is using that port (8009) and I tried other ports but to no avail.

Thank you

Upvotes: 0

Views: 675

Answers (2)

dsp_user
dsp_user

Reputation: 2119

I resolved my problem by reinstalling Netbeans, recreating all the projects (re-importing the workspace) and reinstalling Tomcat.

It seems that Netbeans can sometimes (on deployment in my case) mess up the Tomcat installation irreparably and the only way (or at least the easiest way) is to reinstall everything, which in my case took about 30-40 minutes. (and I spent days trying to troubleshoot)

Upvotes: 0

Pankaj Pandey
Pankaj Pandey

Reputation: 1043

It seems 8009 port is using some where

Please check your port is running or not using below command in window

netstat -aon | findstr 8009

and kill the process if you find any using

taskkill /pid <pid>

Upvotes: 1

Related Questions