0

Let's say I have a JNDI Binding with a port number in it like this:

<subsystem xmlns="urn:jboss:domain:naming:2.0">
    <bindings>
        <simple name="java:global/test/SOMEURL" value="http://localhost:8080/someurl"/>
    <bindings/>
</subsystem>

And I want the port to be the actual port of the JBoss instance.

The port is set via -Djboss.socket.binding.port-offset=x

I have tried it like this, but it always defaults to 8080:

<simple name="java:global/test/SOMEURL" value="http://localhost:${jboss.http.port:8080}/someurl"/>

Is there any way to read the current port, or to add jboss.socket.binding.port-offset to 8080 manually?

MauriceNino
  • 6,214
  • 1
  • 23
  • 60

1 Answers1

0

Starting JBoss with the offset attribute will

standalone.sh -Djboss.socket.binding.port-offset=10

The port-offset is an attribute to modify the port biding all at the same time. For example, the default value is 0, which means that HTTP port will be 8090, remoting will be offset by the same number. As explained by Mendieta.

If you use ${jboss.socket.binding.port-offset:100}, http port will be 8180 (8080+100), the same for remoting.

For your specific case, I think you could define an interface, for the biding:

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

Or if that's the case, you could try to create a socket binding group with the port you need.

Marcello B.
  • 4,177
  • 11
  • 45
  • 65