1

I have installed the tomcat on to my computer and used this[use multiple CATALINA_BASE to setup tomcat 6 instances on windows and [http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Multiple_Instances] to get it set up.

They both have different shutdown ports,connector ports, redirecting ports and ajp ports. they both then started running and I could see that they were running fine. Now when I put the Geoserver.war file on the one they other one seemed to have stopped working and I have no idea why.

I wanted to load the geowebcache.war file on the second one to test out a few things.

Any help on what I need to check to see where the problem is would be appreciated.

UPDATE: Here are the logs from the catalina file:

Apr 24, 2014 12:46:40 PM org.apache.coyote.AbstractProtocol init
SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-apr-8081"]
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:430)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:640)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:978)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:813)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
    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:280)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)

Apr 24, 2014 12:46:40 PM org.apache.catalina.core.StandardService initInternal
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8081]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8081]]
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:813)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
    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:280)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:980)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    ... 12 more
Caused by: 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:430)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:640)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:978)
    ... 13 more

Apr 24, 2014 12:46:40 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8010"]
Apr 24, 2014 12:46:40 PM org.apache.coyote.AbstractProtocol init
SEVERE: Failed to initialize end point associated with ProtocolHandler ["ajp-apr-8010"]
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:430)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:640)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:978)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:813)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
    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:280)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)

Apr 24, 2014 12:46:40 PM org.apache.catalina.core.StandardService initInternal
SEVERE: Failed to initialize connector [Connector[AJP/1.3-8010]]
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:559)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:813)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:638)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:663)
    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:280)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:454)
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:980)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
    ... 12 more
Caused by: 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:430)
    at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:640)
    at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434)
    at org.apache.catalina.connector.Connector.initInternal(Connector.java:978)
    ... 13 more

Im not to sure if that would help.

Community
  • 1
  • 1
Ravyn
  • 157
  • 4
  • 21
  • Are they both set up to run as Windows services? What does the last entry in the file catalina..log say? You can find it in your Tomcat folder under the "logs" directory. – Nathan Apr 24 '14 at 13:59
  • @Nathan The one seems to run as a service the other one does not. I have updated my post to show the logs from the catalina file. – Ravyn Apr 25 '14 at 08:21
  • After by some strange workings I some how managed to get it working but I don't think its running a 100% because after a while the instance that the geowebcache is running seems to magically shut itself down, and if I run them both it seems the second one that has geoserver running tends to freeze or stop working. – Ravyn Apr 25 '14 at 08:25
  • I would remove the service installation and now that you are familiar with how Tomcat is installed, I would go through the process again (headache, I know) and be very careful to set them up properly. From the looks of the log files there is a socket that is getting mixed up which most likely means it is trying to use the same port that something else is using. – Nathan Apr 25 '14 at 12:08

1 Answers1

0

@Ravyn I am not sure why you want two Tomcat servers running and if that is necessary you can definatly do it but for ease of installation I would install Tomcat with the default settings, meaning connector port 8080, and use the GeoServer installer to install GeoServer on another port, say 8081. If this is you local machine and not a server, install manual installations of both so that you can free these ports up for other development products you may use.

Here is the GeoServer installer documentation for quick reference.

Write out the ports you are going to assign to each webserver. Tomcat 7 defaults for example:

Connector Port: 8080 (Default)

Shutdown Port: 8005 (Default)

AJP Port: 8009 (Default)

Redirect Port: 8443 (Default)

Be aware that in Tomcat's configuration the redirect port is defined in both the HTTP/1.1 and AJP/1.3 settings and should match.

Troubleshooting
If you find that you receive a JVM_Binding error, here are a few terminal commands to help you figure out what process is bound to what port.

Open a command prompt and enter the following: netstat -nao | findstr ":80" This will search the netstat results for ports that have an ":80" somewhere inside the description. Ports :8080 and :80 are commonly utilizes by webservers.

After you run that command find the port that you are trying to occupy with one of your Tomcat instances. For this example we will assume that the default port of :8080 is being used.

Run the following command to search the tasklist result list for the port you are inquiring after. tasklist | findstr "2260"//2260 is an example and you should substitute your own PID, (The far right number in your command prompt results)

Once you find the process you should be able to make the necessary changes to your configuration or set up to enable Tomcat to run. I hope something I point out here helps and you are able to get your webservers up and running!

Nathan
  • 3,082
  • 1
  • 27
  • 42
  • 1
    It does indeed make sense to install two Tomcat servers on a single machine if the configurations on server level (in the *server.xml*-sense) are very different. – B--rian Aug 16 '17 at 13:28
  • @B--rian, you are correct. Since providing this answer I have run multiple Tomcat instances on a single machine for the reason you mentioned. – Nathan Aug 16 '17 at 16:08