3
votes

Problem JBoss is unable to port-forward its http transport for web service endpoints using Vagrant/VirtualBox.

Background

We are using Vagrant to host a centOS box with WSO2 ESB, JBoss EAP, and Oracle XE. I have set up the port-forwarding as such within the Vagrantfile:

Vagrantfile

config.vm.network :forwarded_port, guest: 9994, host: 9994 # JBOSS Admin Console 
config.vm.network :forwarded_port, guest: 8084, host: 8084 # JBOSS Endpoints
config.vm.network :forwarded_port, guest: 10003, host: 10003 # JBOSS Maven Deploy
config.vm.network :forwarded_port, guest: 9443, host: 9443 # WSO2 Console admin/admin
config.vm.network :forwarded_port, guest: 8243, host: 8243 # WSO2 Endpoints
config.vm.network :forwarded_port, guest: 8280, host: 8280 # WSO2 Endpoints
config.vm.network :forwarded_port, guest: 1521, host: 1521 # Oracle XE

JBoss standalone.xml

<interfaces>
        <interface name="management">
            <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
        </interface>
        <interface name="public">
            <inet-address value="${jboss.bind.address:127.0.0.1}"/>
        </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:4}">
        <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="8080"/>
        <socket-binding name="https" port="8443"/>
        <socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>
        <socket-binding name="jgroups-tcp" port="7600"/>
        <socket-binding name="jgroups-tcp-fd" port="57600"/>
        <socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>
        <socket-binding name="jgroups-udp-fd" port="54200"/>
        <socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>
        <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>

I can hit everything perfectly from the host system except for port 8084. I can curl the endpoints in the vm and the WSDLs are being hosted correctly in the guest vm.

Things I've tried

  • I've tried changing just the host port in the Vagrantfile - Same result
  • I've tried changing the port in the JBoss Standalone xml, then changing the guest and host ports in the Vagrantfile - Same result
  • I've tried switching to using a private network configuration with Vagrant instead of the NAT port-forwarding - Same result

Due to my testing above, I feel like I have ruled out Vagrant/Virtual Box as the problem. I think it has something to do with a configuration in JBoss in regards to the http transport.

Any ideas?

1
It looks like you are binding JBoss AS only to 127.0.0.1. Try changing the binding to 0.0.0.0 so that the server will bind to all ip addresses in your virtual box.randominstanceOfLivingThing
Thank you for the response, I appreciate it. I am changing the binding the in the start script: sh /home/vagrant/Applications/jboss/EAP-6.2.0e/jboss-eap-6.2/bin/standalone.sh -b $IP -Djboss.bind.address.management=0.0.0.0 -Dorg.jboss.as.logging.per-deployment=false -Djboss.node.name=$HOSTNAME > /home/vagrant/Applications/jboss/jboss.log 2>&1 &Dan Mikita

1 Answers

2
votes

After lots of research I found a solution. This was the original webservice subsystem:

<subsystem xmlns="urn:jboss:domain:webservices:1.1">
        <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>
</subsystem>

I found an article here https://docs.jboss.org/author/display/JBWS/Advanced+User+Guide?_sscc=t which describes the server configuration options. By making the following changes, I fixed my issue:

<subsystem xmlns="urn:jboss:domain:webservices:1.1">
        <modify-wsdl-address>true</modify-wsdl-address>
        <wsdl-host>localhost</wsdl-host>
        <wsdl-port>8084</wsdl-port>
        <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>
</subsystem>

I basically just changed the wsdl-host to be localhost, and I added the wsdl-port of 8084. I hope this helps anyone else out there!