cannot start Tomcat 7 server - java.net.BindException: Address already in use - eclipse

Hi i am not able to start tomcat 7 server from eclipse.
When i give start from eclipse i get the following error log.
Jan 11, 2013 10:10:27 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\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\Jayant\Desktop\data\adt-bundle-windows-x86\eclipse;;.
Jan 11, 2013 10:10:28 AM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jan 11, 2013 10:10:28 AM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 11, 2013 10:10:28 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1165 ms
Jan 11, 2013 10:10:28 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jan 11, 2013 10:10:28 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Jan 11, 2013 10:10:28 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jan 11, 2013 10:10:28 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 11, 2013 10:10:28 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 507 ms
Jan 11, 2013 10:10:28 AM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]:
java.net.BindException: Address already in use: JVM_Bind
at java.net.DualStackPlainSocketImpl.bind0(Native Method)
at java.net.DualStackPlainSocketImpl.socketBind(Unknown Source)
at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
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:422)
at org.apache.catalina.startup.Catalina.await(Catalina.java:707)
at org.apache.catalina.startup.Catalina.start(Catalina.java:653)
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:303)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
Jan 11, 2013 10:10:28 AM org.apache.coyote.AbstractProtocolHandler pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Jan 11, 2013 10:10:29 AM org.apache.coyote.AbstractProtocolHandler pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Jan 11, 2013 10:10:30 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Jan 11, 2013 10:10:30 AM org.apache.coyote.AbstractProtocolHandler stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Jan 11, 2013 10:10:30 AM org.apache.coyote.AbstractProtocolHandler stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Now i am getting the following error.
Jan 11, 2013 10:18:59 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\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\Jayant\Desktop\data\adt-bundle-windows-x86\eclipse;;.
Jan 11, 2013 10:19:00 AM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jan 11, 2013 10:19:00 AM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jan 11, 2013 10:19:00 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 872 ms
Jan 11, 2013 10:19:00 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jan 11, 2013 10:19:00 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Jan 11, 2013 10:19:00 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jan 11, 2013 10:19:00 AM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jan 11, 2013 10:19:00 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 535 ms
Jan 11, 2013 10:20:13 AM org.apache.catalina.core.StandardServer await
WARNING: StandardServer.await: Invalid command 'GET / HTTP/1.1' received
Jan 11, 2013 10:20:19 AM org.apache.catalina.core.StandardServer await
WARNING: StandardServer.await: Invalid command '' received

Go to server.xml file and change
<Server port="8005" shutdown="SHUTDOWN">
to
<Server port="8006" shutdown="SHUTDOWN">

The admin port is for receiving admin commands,and the HTTP port is for receiving HTTP requests. You must use different ports. What happened is: the HTTP connector could not start, because the server already opened that port. Your browser/client/whatever sent the request to the admin port , the server does not understand HTTP and logs this error.
Try Reinstalling Tomcat to another port.

In Windows 10 port 8005 is already reserved (for something). Change to for example 8089 (or any free port) in tomcat/conf/server.xml

use:
pkill -f tomcat
to get rid of any existing or un-responsive tomcat instances or processes.
start tomcat.

I was having this problem (port 8005 already being used) and the root cause was due to an existing tomcat process already running on my machine. So, what I needed to do was basically kill the existing process and start up tomcat again.

The common mistake is to use the same Shutdown and Connector port in your server.xml configuration file.
These ports should be different and here is the right example:
<Server port="8005" shutdown="SHUTDOWN">
<Connector port="8983" protocol="HTTP/1.1"
By default Tomcat listens on port 8005 for SHUTDOWN command and it should be always different to Connector port.
If your port is still already in use, try sudo lsof -i:8005 for finding why.

If you are using linux system, then type ps -ef|grep tomcat on terminal. Then find the process id(PID). then type kill -9 on the terminal. Now , start the tomcat server.

2 ways to solve this issue:
1> Go the tomcat server installation directory and open the server.xml file, check if the
Connector and server ports are different. If not make them different ports and then check if nothing is run on these ports
2> Open command prompt from start and type netstat -ano | findstr 8010 to check if the port are being used. if they are used then you get the
TCP 0.0.0.0:8005 0.0.0.0:0 LISTENING 4
TCP [::]:8005 [::]:0 LISTENING 4
then
a> kill the process using the process id (4 in my case) from the task manager
If they are not being used then you see nothing in cmd

If you have multiple apps, check if any of the other apps use the same server port defined in the server.xml file. This was the case for me.

For me (as I was using tomcat server on VS Code).
Tomcat provides a interface called "configure tomcat", there are a options below service status like start, stop etc. The reason I think your terminal showing error is due to internally tomcat is already using that port so you can stop the port from there and start your tomcat server from your IDE terminal.
For detail description and If you OS is windows, search Services and inside you can see the option 'Apache Tomcat'

for people using IntelliJ
Goto Run --> Edit configurations
In the configuration that exists for Tomcat server, change the Admin port

What you can do is rather then killing process you can goto tomcat directory/conf/server.xml, Here you can change shutdown port(8005) to some other port. Also change default port (8080) and other to Different one. So you can run several instance of your Tomcat on single Machine. Restart Your Server (if still issue persists) Recreate it in Eclipse.

Related

Tomcat persistence manager using MongoDB as a Persistence store leads problems

I used Tomcat Persistence manager with MongoDB as a persistence store.I am getting lot of problems related to this.
Tomcat not going to shutdown properly. I need to kill it later.
It showing log like this.
Tomcat Log::: Jun 28, 2016 6:36:23 AM org.apache.catalina.core.StandardServer await
INFO: A valid shutdown command was received via the shutdown port.Stopping the Server instance.
Jun 28, 2016 6:36:23 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-9082"]
Jun 28, 2016 6:36:23 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Jun 28, 2016 6:36:23 AM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Jun 28, 2016 6:36:23 AM com.mongodb.diagnostics.logging.JULLogger log
INFO: Closed connection [connectionId{localValue:24, serverValue:619}] to <host ip>:<port> because the underlying connection was closed.
After that no response.Then I manually killed that process.
MongoDB collection creating documents more than I expected(approxiamately 100 times). I took reference from these pages.
Tomcat Persistence manager
Mongo Store
Can Any One help regarding these issues?

Apache tomcat server startup increase over 30000 ms in eclipse Kepler

when i run my JSP page on apache tomcat 7 in my eclipse, server output shows up in 30000ms or more some times it never starts up, at first output got in lessthan 700ms,
Any help or suggession on this problem...
sample output...
NFO: Starting Servlet Engine: Apache Tomcat/7.0.12
Mar 18, 2014 10:42:39 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [156] milliseconds.
Mar 18, 2014 10:42:58 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mar 18, 2014 10:42:58 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Mar 18, 2014 10:42:58 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 30553 ms
Consider the following 2 suggestions:
1)As I commented above check if more then one application is running on the same server.This could be the primary reason.May be 3 or 4 applications might be running once you start your tomcat service.
2)May be some library that you are using for your application is creating some problem,for example the library might be initializing some file storage or may be something else.For this you will have to debug and check your stacktraces.

Can't get my webapp accessible using eclipse, apache2 and tomcat7 (Ubuntu)

I'm quite a rookie about servlets, but I should deploy an Eclipse web project running on a Tomcat server (only localhost).
The whole process worked fine on Windows but recently I had to move to Ubuntu 12.04 and I have this problem when I want to access the app:
If I start apache2 and tomcat7 first, the output of
sudo netstat -lpn |grep :80
looks like this:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 12231/apache2
tcp6 0 0 127.0.0.1:8005 :::* LISTEN 12848/java
tcp6 0 0 :::8080 :::* LISTEN 12848/java
then I try to start the server in eclipse and face this error:
Several ports (8005, 8080) required by cdrserver are already in use. The server may already >be running in another process, or a system process may be using the port. To start this >server you will need to stop the other process or change the port number(s).
Alright, let's kill these processes (although it seems that Tomcat uses them since when i stop tomcat, the 2 tcp6 processes disappear).
Now I'm able to start the Eclipse server, without a single warning:
Nov 27, 2013 10:59:24 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Nov 27, 2013 10:59:24 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 869 ms
Nov 27, 2013 10:59:24 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Nov 27, 2013 10:59:24 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Nov 27, 2013 10:59:24 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/aron/workspace/Text_manipulator
Nov 27, 2013 10:59:26 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/aron/workspace/.metadata
Nov 27, 2013 10:59:26 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/aron/workspace/Servers
Nov 27, 2013 10:59:26 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Nov 27, 2013 10:59:26 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2101 ms
Now, if I type the usual (like on Windows) URL to the browser: localhost/cdr I get this:
Not Found
The requested URL /cdr was not found on this server.
Apache/2.2.22 (Ubuntu) Server at localhost Port 80
Same happens with localhost/manager (I got this tip lately).
Moreover, using localhost:8080/cdr results in a totally blank page.
Here are my Eclipse server settings: http://i.imgur.com/lV6FwTm.png
I also checked the web.xml file in the project, it has the following servlet classes and related mappings:
Faces Servlet
Trinidad Resource Servlet
Resources Servlet
Spring MVC Dispatcher Servlet
Am I missing something obvious?
The requested URL /cdr was not found on this server.
Apache/2.2.22 (Ubuntu) Server at localhost Port 80
Firstly your URL should be something like localhost:8080 , Not localhost since this defaults to localhost:80 and you have apache2 running on your system thats why you get the 404 message of the apache server.
Secondly , I am concerned about the resources being deployed as shown by your logs
Nov 27, 2013 10:59:24 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/aron/workspace/Text_manipulator
Nov 27, 2013 10:59:26 AM org.apache.catalina.startup.HostConfig deployDirectory
**INFO: Deploying web application directory /home/aron/workspace/.metadata** --> ?
Nov 27, 2013 10:59:26 AM org.apache.catalina.startup.HostConfig deployDirectory
**INFO: Deploying web application directory /home/aron/workspace/Servers** --> ?
Nov 27, 2013 10:59:26 AM org.apache.coyote.AbstractProtocol start
What is .metadata ? Isn't this one of the hidden folders created by eclipse to manage workspace. This shouldn't be deployed.
Also what is Servers ? This looks like the server project from eclipse.
I don't see any resource namely cdr being deployed from the logs. So first you need to verify that this particular resource is deployed at all. Secondly, I would advise you to do some reading on how Tomcat works here.

Simple Tomcat Servlet not loaded in Eclipse

I've been following the Servlet and JSP development with Eclipse WTP from vogella.com. I've installed Tomcat 7, copy-pasted the code (a simple Data Access Object and a simple HpptServlet), and started the server from eclipse.
When I open http://localhost:8080/de.vogella.wtp.filecounter/FileCounter in the web, the expected result is:
But I got a 404 error:
And this error log in the console:
Sep 15, 2013 7:27:09 PM 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: /Users/adamatan/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Sep 15, 2013 7:27:09 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:de.vogella.wtp.filecounter' did not find a matching property.
Sep 15, 2013 7:27:09 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Sep 15, 2013 7:27:09 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Sep 15, 2013 7:27:09 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 525 ms
Sep 15, 2013 7:27:09 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 15, 2013 7:27:09 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
Sep 15, 2013 7:27:09 PM org.apache.catalina.core.StandardContext resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base /Users/adamatan/Personal/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/de.vogella.wtp.filecounter does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:138)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:5055)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5235)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
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:724)
Sep 15, 2013 7:27:09 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error in resourceStart()
Sep 15, 2013 7:27:09 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error getConfigured
Sep 15, 2013 7:27:09 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/de.vogella.wtp.filecounter] startup failed due to previous errors
Sep 15, 2013 7:27:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Sep 15, 2013 7:27:09 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Sep 15, 2013 7:27:09 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 255 ms
Relevant information:
Tomcat runs OK from the command line (catalina run).
There is only one instance of Tomcat running at the same time.
I could not get any other Tomcat servlet to run from Eclipse.
Any idea why isn't tomcat running my simple Servlet?
Update: I'm using OSX
I suspect you are running tomcat using an own user - it's a common practice in unix systems - and that that user does not have read privilege to your home directory /Users/adamatan.
Then you could try to add the tomcat user to you the group your user belongs to.
Better yet try to change the server location as described in this so question to a location where eclipse has write access and the tomcat user has read access.
EDIT
Actually its a setting in the Dynamic Web Project wizard, If you choose Dynamic web module version 3.0 (which is default) or higher on the first page then on the last page the checkbox for Generate web.xml deployment descriptor is disabled by default. If you choose 2.5 or lower it is then enabled by default. It has nothing to do with which tomcat you are actually using. If you want to use annotations though, then you have to have tomcat 7 with servlet specs 3.0
It was a Tomcat 6 tutorial, and I was using Tomcat 7.
Eclipse did not create a web.xml file, because it was expecting annotations in the Java code. The tutorial code did not contain any annotations, so the server started without servlets.

Can't start Tomcat in Eclipse (Mac OS X) - java.net.BindException: Can't assign requested address

I have problem using Tomcat v.7.0 on Eclipse on Mac OS X 10.8.2.
I assume the problem is that I have another older version of Tomcat running on the same notebook. But I'm unable to find it and close it / kill it.
When I try to start Tomcat on Eclipse then I get following error:
Nov 10, 2012 2:45:45 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]:
java.net.BindException: Can't assign requested address
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:427)
at org.apache.catalina.startup.Catalina.await(Catalina.java:766)
at org.apache.catalina.startup.Catalina.start(Catalina.java:712)
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:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:451)
Full log is below.
I tried with spotlight and with program Find Any File (http://apps.tempel.org/FindAnyFile/index.php) to find where my Tomcat installations are. I looked for keyword 'catalina.sh' and I deleted all the parent folders for these findings.
I also deleted my eclipse workspace and reinstalled eclipse. Booted my notebook. Didn't help.
When I did a port scan then it didn't reveal anything. See screenshot:
Please advise how should I find out what's bugging Tomcat and how should I remove it.
(I'm new to Java EE and Mac OSX)
Nov 10, 2012 2:45:44 PM 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: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
Nov 10, 2012 2:45:44 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Nov 10, 2012 2:45:44 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Nov 10, 2012 2:45:44 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1553 ms
Nov 10, 2012 2:45:44 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Nov 10, 2012 2:45:44 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.32
Nov 10, 2012 2:45:45 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Nov 10, 2012 2:45:45 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Nov 10, 2012 2:45:45 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 719 ms
Nov 10, 2012 2:45:45 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]:
java.net.BindException: Can't assign requested address
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:427)
at org.apache.catalina.startup.Catalina.await(Catalina.java:766)
at org.apache.catalina.startup.Catalina.start(Catalina.java:712)
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:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:451)
Nov 10, 2012 2:45:45 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8080"]
Nov 10, 2012 2:45:47 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
Nov 10, 2012 2:45:49 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Nov 10, 2012 2:45:49 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-8080"]
Nov 10, 2012 2:45:51 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Nov 10, 2012 2:45:53 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-8080"]
Nov 10, 2012 2:45:53 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
I solved this by specifying
<Server address="0.0.0.0" port="8005" shutdown="SHUTDOWN">
at conf/server.xml.
You have something already running on the same port you are trying to start Tomcat on.
sudo lsof -i :8080 # checks port 80
The default is 8080, it's set in server.xml in the Tomcat conf directory.
Adding
-Djava.net.preferIPv4Stack=true
to my CATALINA_OPTS fixed this for me. Apparently localhost wasn't setup on IPv6.
Author of FAF here :)
I am no Tomcat expert but I suggest you subscribe to the "Macos-x-server" list at lists.apple.com and ask for help there.
Also, did Tomcat ever run on that system? If not, maybe you configured an illegal port. Try changing the port number to one above 1024 and see if that helps.
Lastly, I think you're asking on the wrong site. This is for programming questions. There are other OSX/Server specific sites next to SO that might be the better one to ask this.
Check that you have only one network device going. My problem was resolved as soon as I switched of my WiFi connection to only use my ethernet connection at work. At home the WiFi works fine as that is the only connection I have there.
Do not know why this is happening, I would guess is that Tomcat is getting confused with devices and assigning ports incorrectly.