Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Get http port inside the java

24 views
Skip to first unread message

Fernando Schotten

unread,
Dec 20, 2024, 11:17:34 AM12/20/24
to WildFly
I have the standalone.xml in attachment. 

In the java, i need get the http port, but the System.getProperty("jboss.http.port") not work.

I need get directly from configuration. Can you help?
standalone.xml

Miha Štemberger

unread,
Dec 20, 2024, 12:05:55 PM12/20/24
to Fernando Schotten, WildFly
Hello,

In the standalone.xml file, there is no jboss.http.port property being set, meaning that the default value of 8080 is taken for http port[1]. You should also see that there is no system property listed when visiting the wildfly admin GUI.
That is the reason there is no result when calling System.getProperty("jboss.http.port") , it is not set. Be mindful to take in consideration the  port-offset="${jboss.socket.binding.port-offset:0}" property on socket-binding as it offset the values of ports by the set amount[2].
I am unaware if there is any api that would give you the runtime port value.

Links:

Br,
Miha

V V pet., 20. dec. 2024 ob 17:17 je oseba Fernando Schotten <fernando...@gmail.com> napisala:
I have the standalone.xml in attachment. 

In the java, i need get the http port, but the System.getProperty("jboss.http.port") not work.

I need get directly from configuration. Can you help?

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wildfly/156e17e3-d138-4005-8805-375cfb435c95n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages