5 Replies Latest reply on Mar 14, 2014 5:05 AM by jaikiran

    Port conflict on jboss 7 ONLY with Java 7 (not 6) on any specified port

    creatureoflegend

      So, I'm having a very interesting issue. I'm trying to set up jboss 7 to use 2 IPs and java 7. The 2 IPs work with java 6, but as soon as I switch to 7, there is always a port conflict on whatever port I designate as HTTPS. The java version is, literally, the only variable that effects this. I've tried jdk1.7.0_40, and jdk1.7.0_51 with same exact results.

       

      Before start up, I check the ports I'm about to use w/ "netstat -ab" to make sure nothing else is eating them up. Tried many different numbers with no success.

       

      Here is the error part of the log when starting with java 7:

       

      [code]

      19:09:40,748 INFO  [org.apache.coyote.http11] (MSC service thread 1-1) JBWEB003001: Coyote HTTP/1.1 initializing on : http-/0.0.0.0:28181

      19:09:40,748 INFO  [org.apache.coyote.http11] (MSC service thread 1-1) JBWEB003000: Coyote HTTP/1.1 starting on: http-/0.0.0.0:28181

      19:09:40,998 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on 0.0.0.0:24447

      19:09:41,482 ERROR [org.apache.coyote.http11] (MSC service thread 1-2) JBWEB003043: Error initializing endpoint: java.net.BindException: Address already in use: JVM_Bind /0.0.0.0:28443

          at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:973) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

          at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:174) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

          at org.apache.catalina.connector.Connector.init(Connector.java:982) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

          at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:273) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]

          at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]

       

       

      19:09:41,498 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.web.connector.HTTPS: org.jboss.msc.service.StartException in service jboss.web.connector.HTTPS: JBAS018007: Error starting web connector

          at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:277)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]

          at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]

      Caused by: LifecycleException:  JBWEB000023: Protocol handler initialization failed

          at org.apache.catalina.connector.Connector.init(Connector.java:984)

          at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:273)

          ... 5 more

      [/code]

      Here is the same area in the same jboss with the only thing being changed is the java version (jdk1.6.0_17):

       

      [code]

      19:05:39,811 INFO  [org.apache.coyote.http11] (MSC service thread 1-2) JBWEB003001: Coyote HTTP/1.1 initializing on : http-/0.0.0.0:28181

      19:05:39,826 INFO  [org.apache.coyote.http11] (MSC service thread 1-2) JBWEB003000: Coyote HTTP/1.1 starting on: http-/0.0.0.0:28181

      19:05:39,842 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (IronJacamar 1.0.17.Final-redhat-1)

      19:05:40,764 INFO  [org.apache.coyote.http11] (MSC service thread 1-2) JBWEB003001: Coyote HTTP/1.1 initializing on : http-/myFirstIpCensoredForSecurityPurposes:28443

      19:05:40,764 INFO  [org.apache.coyote.http11] (MSC service thread 1-2) JBWEB003000: Coyote HTTP/1.1 starting on: http-/myFirstIpCensoredForSecurityPurposes:28443

      19:05:40,998 INFO  [org.apache.coyote.http11] (MSC service thread 1-2) JBWEB003001: Coyote HTTP/1.1 initializing on : http-/mySecondIpCensoredForSecurityPurposes:28443

      19:05:41,014 INFO  [org.apache.coyote.http11] (MSC service thread 1-2) JBWEB003000: Coyote HTTP/1.1 starting on: http-/mySecondIpCensoredForSecurityPurposes:28443

      [/code]

      Here is the standalone.xml that configures the domains (the port number is actually passed in dynamically through the windows service, so they will differ. But they are the same ones that are erroring out on java 7 and not java 6).

       

      [code]

      ...

          <subsystem xmlns="urn:jboss:domain:web:1.4" default-virtual-server="default-host" native="false">

              <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>

              <connector name="HTTPS" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true">

                  <ssl name="https" key-alias="tomcat" password="changeme" certificate-key-file="${jboss.server.config.dir}/iAmAKeyStore.jks"/>

              </connector>

              <connector name="myFirstDomainSocketBindingConnector" protocol="HTTP/1.1" scheme="https" socket-binding="myFirstDomainSocketBinding" secure="true">

                  <ssl name="myFirstDomainSocketBindingSSL" key-alias="theAlias" password="iAmAPassword" certificate-key-file="${jboss.server.config.dir}/myFirstDomainKeystore.jks"/>

              </connector>

              <connector name="mySecondDomainSocketBindingConnector" protocol="HTTP/1.1" scheme="https" socket-binding="mySecondDomainSocketBinding" secure="true">

                  <ssl name="mySecondDomainSocketBindingSSL" key-alias="theSecondAlias" password="iAmAPasswordToo" certificate-key-file="${jboss.server.config.dir}/mySecondDomainKeystore.jks"/>

              </connector>

              <virtual-server name="default-host" enable-welcome-root="false">

                  <alias name="localhost"/>

                  <alias name="example.com"/>

              </virtual-server>

          </subsystem>

          <subsystem xmlns="urn:jboss:domain:webservices:1.2">

              <modify-wsdl-address>true</modify-wsdl-address>

              <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>

              <endpoint-config name="Standard-Endpoint-Config"/>

              <endpoint-config name="Recording-Endpoint-Config">

                  <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">

                      <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>

                  </pre-handler-chain>

              </endpoint-config>

              <client-config name="Standard-Client-Config"/>

          </subsystem>

          <subsystem xmlns="urn:jboss:domain:weld:1.0"/>

      </profile>

       

       

      <interfaces>

          <interface name="firstDomainInterface">

              <inet-address value="myFirstIpCensoredForSecurityPurposes"/>

          </interface>

          <interface name="secondDomainInterface">

              <inet-address value="mySecondIpCensoredForSecurityPurposes"/>

          </interface>

          <interface name="management">

              <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>

          </interface>

          <interface name="public">

              <inet-address value="${jboss.bind.address:0.0.0.0}"/>

          </interface>

          <interface name="unsecure">

              <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>

          </interface>

      </interfaces>

       

       

      <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

          <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>

          <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>

          <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>

          <socket-binding name="ajp" port="8009"/>

          <socket-binding name="http" port="${jboss.http.port:80}"/>

          <socket-binding name="https" port="${jboss.https.port:443}"/>

          <socket-binding name="myFirstDomainSocketBinding" interface="firstDomainInterface" port="${jboss.https.port:443}"/>

          <socket-binding name="mySecondDomainSocketBinding" interface="secondDomainInterface" port="${jboss.https.port:443}"/>

          <socket-binding name="remoting" port="4447"/>

          <socket-binding name="txn-recovery-environment" port="4712"/>

          <socket-binding name="txn-status-manager" port="4713"/>

          <outbound-socket-binding name="mail-smtp">

              <remote-destination host="localhost" port="25"/>

          </outbound-socket-binding>

      </socket-binding-group>

      [/code]

       

      Jboss version: JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8)

      Environment: Windows Server 2008 R2, 4gb ram, 64 bit

      Java: jdk1.7.0_51/jdk1.6.0_17

       

      Note: I tried asking this on stack overflow: no responses. Hoping to have better luck here.

        • 1. Re: Port conflict on jboss 7 ONLY with Java 7 (not 6) on any specified port
          wdfink

          Are you sure that all processes are down if you start the server?

          I did not see this issue on Unix.

          Is it exeact the same server and configuration?

          How do you start the server?

          • 2. Re: Port conflict on jboss 7 ONLY with Java 7 (not 6) on any specified port
            creatureoflegend

            Yeah, the processes are all down. Just in case, I check the ports i'm about to use with netstat -ab and search for the port in the output: nothing found. Once I fire up the server it errors out. Keeps erroring on re-deploys as long as I use java 7. As soon as I switch back to java 6, the errors go away.

             

            But, strangely, even though there are these errors in the log, I just checked the web application deployed on the server and still runs. I'm not sure why, or if I should be concerned about further errors.

             

            "Is it exeact the same server and configuration?"

            Yes, the only thing I change is the java version.


            "How do you start the server?"

            I use a windows service that is installed via service.bat: Running JBoss Web as Windows service - JBoss Community


            Edit: both versions of java I use are 32 bit (if that matters)

            • 3. Re: Port conflict on jboss 7 ONLY with Java 7 (not 6) on any specified port
              jaikiran

              19:09:41,482 ERROR [org.apache.coyote.http11] (MSC service thread 1-2) JBWEB003043: Error initializing endpoint: java.net.BindException: Address already in use: JVM_Bind /0.0.0.0:28443

               

              It looks like in the case where it errors out, it's using the "public" interface which binds to 0.0.0.0 instead of using the firstDomainInterface and secondDomainInterface. Now I don't see why that would be the case when you just switch the JDK version.

              1 of 1 people found this helpful
              • 4. Re: Port conflict on jboss 7 ONLY with Java 7 (not 6) on any specified port
                creatureoflegend

                So, putting the java version aside for the moment, is this port conflict supposed to happen if you use both public 0.0.0.0 interface + 1 or two defined IP interfaces or is it a prboblem? If it's a problem, is it a problem w/ jboss server itself or my configuration of it?

                • 5. Re: Port conflict on jboss 7 ONLY with Java 7 (not 6) on any specified port
                  jaikiran

                  CreatureOfLegend wrote:

                   

                  So, putting the java version aside for the moment, is this port conflict supposed to happen if you use both public 0.0.0.0 interface + 1 or two defined IP interfaces

                  I don't expect it to throw a  "JVM_BIND port already in use exception" if you bind a service to 0.0.0.0:1234 and a service to xxx.xxx.xxx.xxx:1234. I expect it to run into this exception if you end up using the same IP/port combo. So in this case, I expect this to fail if you of your socket binding using the same port for the same 0.0.0.0 binding address.