Tomcat starts with java.net.BindException: Address already in use exception - eclipse

Thanks in advance for any help!
I have reviewed ALL related posts on stackoverflow and none answer my problem.
Context:
Windows 10, Eclipse Neon.1 Release (4.6.1) with Tomcat support and Java 1. all of this running on a MacBook Pro running MacOS Sierra 10.12.1 in a Parallels Desktop 12 for Mac Pro Edition 12.1.0 virtual Windows 10.
When I start Eclipse everything is fine.
When I click the Eclipse Tomcat start button I get these exceptions:
16-Nov-2016 10:55:10 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: C:\Program Files\Java\jre6\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Parallels\Parallels Tools\Applications;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_102;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Private Shell;C:\PROGRA~2\COMMON~1\Odbc\FILEMA~1;C:\Users\terry.QUANTECH\AppData\Local\Microsoft\WindowsApps;;.
16-Nov-2016 10:55:10 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
16-Nov-2016 10:55:10 AM org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind <null>:8080
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:563)
at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:181)
at org.apache.catalina.connector.Connector.initialize(Connector.java:1141)
at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:843)
at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
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.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(Unknown Source)
at java.net.ServerSocket.bind(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at java.net.ServerSocket.<init>(Unknown Source)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:50)
at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:552)
... 12 more
16-Nov-2016 10:55:10 AM org.apache.catalina.core.StandardService initialize
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8080]]
LifecycleException: Protocol handler initialization failed: java.net.BindException: Address already in use: JVM_Bind <null>:8080
at org.apache.catalina.connector.Connector.initialize(Connector.java:1143)
at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:843)
at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
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.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
16-Nov-2016 10:55:11 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8443
16-Nov-2016 10:55:11 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 583 ms
16-Nov-2016 10:55:11 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
16-Nov-2016 10:55:11 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.45
16-Nov-2016 10:55:11 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor gomenu.xml
16-Nov-2016 10:55:11 AM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\gomenu inside the host appBase has been specified, and will be ignored
16-Nov-2016 10:55:11 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor gps.xml
16-Nov-2016 10:55:11 AM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\gps inside the host appBase has been specified, and will be ignored
etc.
I look for what is running on port 8080 using TCPView and see:
javaw.exe 1676 TCP TerryWin10onMac 8080 TerryWin10onMac 0 LISTENING
javaw.exe 1676 TCPV6 terrywin10onmac.quantechsoftware.local 8080 terrywin10onmac.quantechsoftware.local 0 LISTENING
So it is Java and presumably Tomcat that has grabbed port 8080 twice.
I stop Tomcat, close Eclipse and see that all references in TCPView to port 8080 disappear.
I start Eclipse. TCPView still shows no references to port 8080.
I start Tomcat and see that a whole bunch of things appear in TCPView, two of which refer to port 8009 and two to 8080:
javaw.exe 7076 TCP TerryWin10onMac 8005 TerryWin10onMac 0 LISTENING
javaw.exe 7076 TCP TerryWin10onMac 8009 TerryWin10onMac 0 LISTENING
javaw.exe 7076 TCPV6 terrywin10onmac.quantechsoftware.local 8009 terrywin10onmac.quantechsoftware.local 0 LISTENING
javaw.exe 7076 TCP TerryWin10onMac 8080 TerryWin10onMac 0 LISTENING
javaw.exe 7076 TCPV6 terrywin10onmac.quantechsoftware.local 8080 terrywin10onmac.quantechsoftware.local 0 LISTENING
javaw.exe 7076 TCP TerryWin10onMac 8443 TerryWin10onMac 0 LISTENING
javaw.exe 7076 TCPV6 terrywin10onmac.quantechsoftware.local 8443 terrywin10onmac.quantechsoftware.local 0 LISTENING
And, of course, all the same exceptions as before.
I have tried to kill one of the 8080 processes, but they both have the same process ID! In fact, all of the port listeners shown above have the same PID.
It is not an option for me to change the port.
Any help with this at all would be greatly appreciated.
Many thanks,
Terry Kilshaw

+1 for the detailed description of your research.
I recommend to you to review the <tomcat_home>\conf\server.xml file and check all the ports declared into. Maybe the 8080 is repeated.
And do the same checking in the Eclipse's Server configuration: See that no port numbers are repeated.

Related

Zookeeper and Solr - unable to start the cluster

I've inherited a platform which runs Zookeeper and Solr. The main problem at first was the zoo.cfg and Zookeeper had old setup so DNS named resolution wasn't working.
I've already fixed. I also fixed the issue of the myid value in /var/lib/zookeeper thanks to this thread (someone left a string value there...)
Zookeeper - three nodes and nothing but errors
Now, the output of logs is different:
2017-08-28 14:24:19,368 [myid:3] - WARN [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager#400] - Cannot open channel to 2 at election address zookeeper-test-2/10.240.102.89:3888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2017-08-28 14:24:19,368 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2181:QuorumPeer$QuorumServer#149] - Resolved hostname: zookeeper-test-2 to address: zookeeper-test-2/10.240.102.89
2017-08-28 14:24:19,368 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2181:FastLeaderElection#852] - Notification time out: 400
and If I run this script from one EC2 inside the VPC I can see is almost working:
+
+ SOLR
+ Online Nodes: 2
+ solrcloud-test-2 [ Connection to 8983 succeeded ]
+ solrcloud-test-1 [ Connection to 8983 succeeded ]
-------------
+ ELB not responding properly. HTTP response: 503
+
+ ZOOKEEPER
+ Online Instances: 3
+ zookeeper-test-3 [ Connection to 2181 succeeded ]
+ zookeeper-test-2 [ Connection to 2181 succeeded ]
+ zookeeper-test-1 [ Connection to 2181 succeeded ]
+ Minimal Configured: 3
+ Cluster Status: UP
as you can see even the Solr Ec2 seems to be online the ELB doesn't detect the path of the Solr.
I checked the parameters of how Tomcat was bringing up the Solr and I detected again a misconfiguration related to the hostnames so I fixed and restarted Tomcat, however my ELB health check still does not detect the url.
This check is setup as
HTTP:8983/solr/
I do a netstat I can see the port up and listening
[root#solrcloud-test-2 ~]# netstat -lnp |grep 8983
tcp 0 0 :::8983 :::* LISTEN 3338/java
Moreover another thing I noticed is even I restarted tomcat the logs of serviced are freezed in the past 25th of August!
ERROR - 2017-08-25 17:10:25.369; org.apache.solr.common.SolrException; null:org.apache.solr.common.SolrException: java.net.UnknownHostException: zookeeper-1: unknown error
at org.apache.solr.common.cloud.SolrZkClient.<init>(SolrZkClient.java:139)
at org.apache.solr.cloud.ZkController.<init>(ZkController.java:207)
at org.apache.solr.core.ZkContainer.initZooKeeper(ZkContainer.java:152)
at org.apache.solr.core.ZkContainer.initZooKeeper(ZkContainer.java:67)
at org.apache.solr.core.CoreContainer.load(CoreContainer.java:216)
at org.apache.solr.servlet.SolrDispatchFilter.createCoreContainer(SolrDispatchFilter.java:189)
at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:136)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4939)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5633)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.UnknownHostException: zookeeper-1: unknown error
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
at java.net.InetAddress.getAllByName(InetAddress.java:1192)
at java.net.InetAddress.getAllByName(InetAddress.java:1126)
at org.apache.zookeeper.client.StaticHostProvider.<init>(StaticHostProvider.java:61)
at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:445)
at org.apache.zookeeper.ZooKeeper.<init>(ZooKeeper.java:380)
at org.apache.solr.common.cloud.SolrZooKeeper.<init>(SolrZooKeeper.java:41)
at org.apache.solr.common.cloud.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:37)
at org.apache.solr.common.cloud.SolrZkClient.<init>(SolrZkClient.java:114)
... 22 more
INFO - 2017-08-25 17:10:25.370; org.apache.solr.servlet.SolrDispatchFilter; SolrDispatchFilter.init() done
ERROR - 2017-08-25 17:10:25.525; org.apache.solr.core.CoreContainer; CoreContainer was not shutdown prior to finalize(), indicates a bug -- POSSIBLE RESOURCE LEAK!!! instance=650576553
But in the other hand the catalina.out
INFO: Deploying web application archive /var/lib/tomcat7/webapps/solr.war
Aug 29, 2017 8:39:26 AM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Aug 29, 2017 8:39:26 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: One or more Filters failed to start. Full details will be found in the appropriate container log file
Aug 29, 2017 8:39:26 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/solr] startup failed due to previous errors
Aug 29, 2017 8:39:26 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /var/lib/tomcat7/webapps/solr.war has finished in 3,447 ms
Aug 29, 2017 8:39:26 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8983"]
Aug 29, 2017 8:39:26 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8443"]
Aug 29, 2017 8:39:26 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Aug 29, 2017 8:39:26 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3579 ms
So maybe my problem here is I don't know how exactly restart the Solr component? Is really my first work with this software so apologies if my questions are totally noob :)
UPDATE:
I found new info in the logs. Now I think I'm closer to the root issue. However I don't understand the problem, some files missing?
Aug 29, 2017 9:12:11 AM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter SolrRequestFilter
java.lang.NoClassDefFoundError: Failed to initialize Apache Solr: Could not find necessary SLF4j logging jars. If using Jetty, the SLF4j logging jars need to go in the jetty lib/ext directory. For other containers, the corresponding directory should be used. For more information, see: http://wiki.apache.org/solr/SolrLogging
Thanks
Wow, apologies people. Maybe I shot the question very fast. The setup was completely misconfigured so basically to sum up, Zookeeper cluster was partially running because service was up and running but it was lack of service. So Solr was unable to connect to them. Once I was able to bring up Zookeeper to good status Solr could connect to it.
thanks anyway

Not able to integrate Jvisual Vm with Jboss EAP 6.1

I am not able to integrate JVisualVM with jboss EAP 6.1. Below are steps i done:
Edited the startup file and added the below params in that-
JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=3614 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
But i am getting below error:
Please use CMSClassUnloadingEnabled in place of CMSPermGenSweepingEnabled in the future
Could not load Logmanager "org.jboss.logmanager.LogManager"
java.lang.ClassNotFoundException: org.jboss.logmanager.LogManager
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.util.logging.LogManager$1.run(LogManager.java:191)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(LogManager.java:181)
at java.util.logging.Logger.demandLogger(Logger.java:339)
at java.util.logging.Logger.getLogger(Logger.java:393)
at com.sun.jmx.remote.util.ClassLogger.<init>(ClassLogger.java:55)
at sun.management.jmxremote.ConnectorBootstrap.<clinit>(ConnectorBootstrap.java:830)
at sun.management.Agent.startAgent(Agent.java:260)
at sun.management.Agent.startAgent(Agent.java:456)
WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Aug 17, 2017 5:46:51 AM org.jboss.msc.service.ServiceContainerImpl <clinit>
INFO: JBoss MSC version 1.0.4.GA-redhat-1
Aug 17, 2017 5:46:51 AM org.jboss.as.server.ApplicationServerService start
INFO: JBAS015899: JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8) starting
Aug 17, 2017 5:46:52 AM org.jboss.as.controller.AbstractOperationContext executeStep
ERROR: JBAS014612: Operation ("parallel-extension-add") failed - address: ([])
java.lang.RuntimeException: JBAS014670: Failed initializing module org.jboss.as.logging
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$1.execute(ParallelExtensionAddHandler.java:99)
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:440)
at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:322)
at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:229)
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:224)
at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:232)
at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:225)
at org.jboss.as.server.ServerService.boot(ServerService.java:333)
at org.jboss.as.server.ServerService.boot(ServerService.java:308)
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:188)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: JBAS011592: The logging subsystem requires the log manager to be org.jboss.logmanager.LogManager. The subsystem has not be initialized and cannot be used. To use JBoss Log Manager you must add the system property "java.util.logging.manager" and set it to "org.jboss.logmanager.LogManager"
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$1.execute(ParallelExtensionAddHandler.java:91)
... 10 more
Caused by: java.lang.IllegalStateException: JBAS011592: The logging subsystem requires the log manager to be org.jboss.logmanager.LogManager. The subsystem has not be initialized and cannot be used. To use JBoss Log Manager you must add the system property "java.util.logging.manager" and set it to "org.jboss.logmanager.LogManager"
at org.jboss.as.logging.LoggingExtension.initialize(LoggingExtension.java:103)
at org.jboss.as.controller.extension.ExtensionAddHandler.initializeExtension(ExtensionAddHandler.java:97)
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$ExtensionInitializeTask.call(ParallelExtensionAddHandler.java:127)
at org.jboss.as.controller.extension.ParallelExtensionAddHandler$ExtensionInitializeTask.call(ParallelExtensionAddHandler.java:113)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Aug 17, 2017 5:46:52 AM org.jboss.as.server.ServerService boot
FATAL: JBAS015957: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
Thanks & Regards,
Rishabh Jain
To connect with JVisualVM to JBoss, you need to add the jboss-cli-client.jar to the classpath:
$JAVA_HOME/bin/jvisualvm -cp:a $JBOSS_HOME/bin/client/jboss-cli-client.jar
If this jar is not available in your EAP version, then you must add the following modules under $JBOSS_HOME/modules to the classpath:
org/jboss/remoting3/remoting-jmx org/jboss/remoting3 org/jboss/logging org/jboss/xnio org/jboss/xnio/nio org/jboss/sasl org/jboss/marshalling org/jboss/marshalling/river org/jboss/as/cli org/jboss/staxmapper org/jboss/as/protocol org/jboss/dmr org/jboss/as/controller-client org/jboss/threads org/jboss/as/controller
This blog post has a script that you can be used for that. If you are registered customer, you can also download a script here.

Tomcat not running

For some reasons tomcat does not run. I've looked at various tutorials and (as usual) the solutions won't work, I've put the log output below. I have done a fresh install of tomcat as well as linking it to eclipse however when trying to start the service in eclipse this is the output before the server stops.
INFO: Server startup in 488 ms
08-Apr-2013 09:42:23 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(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:406)
at org.apache.catalina.startup.Catalina.await(Catalina.java:676)
at org.apache.catalina.startup.Catalina.start(Catalina.java:628)
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:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
08-Apr-2013 09:42:23 org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
08-Apr-2013 09:42:24 org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
08-Apr-2013 09:42:24 org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
This exception tells you, that some other application is listening on the same port (8005).
The challenge for you is to find the other process that is using the port.
You don't specify what OS you use.
On Windows you could use netstat, under Linux you could give nmapa try to find the other process.
The issue can happen on Windows when nobody don't use port. Namely, Windows TCP engine sometime keep time-wait port for a long time. Solution is wait to Windows release the port or restart.
On Linux the Issue can happen only if there is other process. It can be found with lsof

Tomcat error in eclipse

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
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.
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..
Find out which application hold the port(s) by running
Windows: netstat -no
Linux: netstat -anp
Look for 8005, 8080, 8009 ports listening on either 127.0.0.1 or 0.0.0.0. Lookup the PID (process id) in Task Manager (Windows) or ps (Linux) to find out which program it is, terminate it, and try starting Tomcat again.
The actual cause of this issue was the host file presented at WINDOWS_INSTALLTION/windows/System32/drivers/etc, where in which your old IP address was mapped against localhost like below:
127.0.0.1 localhost
192.168.XXX.XX localhost
This second line was the main culprit, there are two ways of solving this:
Remove 192.168.XXX.XX localhost line completely from host file
Replace old IP with new IP in your host file i.e instead of 192.168.XXX.XX localhost change it to 192.168.XXX.YY localhost
Refer this blog for more details:
http://mprabhat.wordpress.com/2012/11/05/tomcat-java-net-bindexception-cannot-assign-requested-address-jvm_bind/
No Circus,
1.Simply download this "apr-1.5.1-win32-src.zip" from https://apr.apache.org/download.cgi
Extract the folder
place it in the folder, that is in reach of Tomcat, in you case(C:\Users\Rajin\Desktop\eclipse-jee-helios-SR1-win32\eclipse).
Re-run the application/ restart the server.

eclipse and tomcat

I am trying to integrate eclipse with tomcat. My system is Debian Lenny and I have installed tomcat from http://tomcat.apache.org/. My problem is that when launching Tomcat from within eclipse I get the following error:
SEVERE: StandardServer.await: create[8005]:
java.net.SocketException: Invalid argument
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)
Jun 16, 2010 9:54:34 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Jun 16, 2010 9:54:34 PM org.apache.catalina.connector.Connector pause
SEVERE: Protocol handler pause failed
java.net.SocketException: Network is unreachable
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:218)
at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:487)
at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:284)
at org.apache.jk.server.JkMain.pause(JkMain.java:725)
at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:153)
at org.apache.catalina.connector.Connector.pause(Connector.java:1029)
at org.apache.catalina.core.StandardService.stop(StandardService.java:566)
at org.apache.catalina.core.StandardServer.stop(StandardServer.java:744)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:648)
at org.apache.catalina.startup.Catalina$CatalinaShutdownHook.run(Catalina.java:692)
I suspect this is related to the java option java.net.preferIPv4Stack.
Thanks in advance!
I was able to solve this by adding -Djava.net.preferIPv4Stack=true under Run Configurations -> Tomcat 6.0 Server at localhost.