By: Meghana Dhakephalkar user 15 Dec 2016 at 6:57 a.m. CST

4 Responses
Meghana Dhakephalkar gravatar
Hi! I already have tomcat instance running on CentOs. So to get Gluu server's tomcat instance running I have created virtual ethernet interface and using this different IP address I deployed Gluu server. But I am still getting following error in tomcat logs even if a different IP address is used and Gluu server UI is not accessible. : SEVERE: Failed to initialize end point associated with ProtocolHandler ["ajp-bio -10.104.198.254-8009"] java.net.BindException: Address already in use localhost/10.104.198.254:8009 at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:413) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.jav a:651) at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434) at org.apache.catalina.connector.Connector.initInternal(Connector.java:9 78) 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.j ava:821) 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(NativeMethodAccessorImpl. java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.tanukisoftware.wrapper.WrapperStartStopApp.run(WrapperStartStopAp p.java:316) at java.lang.Thread.run(Thread.java:745) Caused by: java.net.BindException: Address already in use at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:37 6) at java.net.ServerSocket.bind(ServerSocket.java:376) at java.net.ServerSocket.<init>(ServerSocket.java:237) at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(De faultServerSocketFactory.java:55) at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:403) ... 22 more Dec 15, 2016 12:45:37 PM org.apache.catalina.core.StandardService initInternal SEVERE: Failed to initialize connector [Connector[AJP/1.3-8009]] I think this is because it is still not pointing to virtual ethernet interface. And if I shutdown tomcat insatnce on main ip address it runs perfectly fine. Any help regarding this would be appreciated. How should run both the tomcat instances? Thanks! Meghana

By Aliaksandr Samuseu staff 15 Dec 2016 at 7:11 a.m. CST

Aliaksandr Samuseu gravatar
Hi, Meghana. Changing default ports Gluu uses isn't considered a standard procedure, and isn't covered by free community support. Your best option is to change port your own Tomcat instance uses, perhaps Tomcat's docs or support forums will be a better place to search for an answer for that.

By Michael Schwartz Account Admin 15 Dec 2016 at 3:16 p.m. CST

Michael Schwartz gravatar
You might try to look at `/opt/tomcat/conf/server.xml` to see if it picked up the wrong ip address for some reason. Also check the apache configuration in `/etc/httpd` Using a virtual ethernet interface should work... Please update this ticket if you are able to resolve it. I'm curious what could be wrong.

By Aliaksandr Samuseu staff 15 Dec 2016 at 5:06 p.m. CST

Aliaksandr Samuseu gravatar
Either it's what Michael supposes, or may be your other Tomcat instance tries to listen on those ports on `0.0.0.0`, i.e., on all interfaces.

By Meghana Dhakephalkar user 16 Dec 2016 at 4 a.m. CST

Meghana Dhakephalkar gravatar
Thanks Aliaksandr and Michael for your support! To get it working, I need to change all references to localhost to specific IP address in files /opt/tomcat/conf/server.xml and /etc/httpd/conf.d/https_gluu.conf. I also need to change the port for AJP protocol in /opt/tomcat/conf/server.xml. In Gluu server container, for etc/hosts file, I am not sure if we can change localhost entry to point to virtual ethernet interface's ip address. I think it is not a standard way but it could have resolved the localhost issue.