Pages

Thursday, June 4, 2015

JBoss 7 – Change Port Number on Runtime

There may be cases some times to change the Port number when Server is running. This may be due to an external service trying to access a JBoss service running on a port which was is configured on different port. During this case it will help if we change the port number running the service to the one that the external service uses. This article tells you on how to change the port during runtime

C:\Users\mjagadish\EAP-6.4.0\bin>jboss-cli.bat
You are disconnected at the moment. Type 'connect' to connect to the server or '
help' for the list of supported commands.
 [disconnected /] connect localhost:10999

[standalone@localhost:10999 /] cd /socket-binding-group=standard-sockets/socket-binding=http

[standalone@localhost:10999 socket-binding=http] ls -l
ATTRIBUTE VALUE TYPE
bound true BOOLEAN
bound-address 127.0.0.1 STRING
bound-port 9080 INT
client-mappings undefined LIST
fixed-port false BOOLEAN
interface undefined STRING
multicast-address undefined STRING
multicast-port undefined INT
name http STRING
port 8080 INT

Gives us the details of the HTTP port and services that are running.

[standalone@localhost:10999 socket-binding=http] :write-attribute(name="port",value="8180")
{
"outcome" => "success",
"response-headers" => {
"operation-requires-reload" => true,
"process-state" => "reload-required"
}
}

We use the write attribute to change the Port number from 8080 to 8180.Once done use the list command to see the changed values

[standalone@localhost:10999 socket-binding=http] ls -l
ATTRIBUTE VALUE TYPE
bound true BOOLEAN
bound-address 127.0.0.1 STRING
bound-port 9080 INT
client-mappings undefined LIST
fixed-port false BOOLEAN
interface undefined STRING
multicast-address undefined STRING
multicast-port undefined INT
name http STRING
port 8180 INT

Now once the changes are done, they will not be reflected until we reload the configuration. This is done using the reload command as

[standalone@localhost:10999 socket-binding=http] cd /
[standalone@localhost:10999 /] reload


Now check the Port by accessing an application running on that.

1 comment :

  1. It's an awesome piece of writing for all the online users; they will take benefit from
    it I am sure.

    Also visit my web page: web master unblocker

    ReplyDelete