40

I am using jboss-7 and I want to change the port number from 8080 to 7001. Which file do I need to change?

lkisac
  • 1,627
  • 21
  • 26
vivek rai
  • 2,081
  • 9
  • 22
  • 21

8 Answers8

43

The file is $JBOSS_HOME/standalone/configuration/standalone.xml. Find <socket-binding-group> and <socket-binding> there.

EDIT

There's multiple ways to do this. The recommended way is to use the management console. If JBoss AS runs on your local computer, open the URL http://localhost:9990/console/App.html#socket-bindings and edit the socket-bindings there. I tested it on Wildfly 8.1.0 Final, don't know if the URL is valid for other versions of JBoss AS.

Ilmo Euro
  • 4,655
  • 1
  • 25
  • 28
28

When starting use

./standalone.sh -b 0.0.0.0 -Djboss.socket.binding.port-offset=1000 & 

- for linux

standalone.bat -Djboss.socket.binding.port-offset=1000 

- windows

here 1000 is the offset value. 8080 + 1000 = 9080 the application will start
Arundev
  • 1,078
  • 16
  • 18
3

go to installation directory .... Mine directory like that

C:\wildfly-10.0.0.CR5\standalone\configuration\

find standalone.xml file, open and change the http port 8080 inside

<socket-binding-group>

Here I change my port number 8080 to 3333

<socket-binding name="http" port="${jboss.http.port:3333}"/>
Usman Maqbool
  • 3,073
  • 10
  • 28
  • 41
1

For Windows:

standalone.bat

is using

standalone.conf.bat

Open in notepad

Add the last 2 lines (as seen below, aka the 2 "Alter Port Settings Offset" lines) (the first 3 lines should already be there...and provide the breadcrumb to where to place the 2 new lines that you need)

rem # Make Byteman classes visible in all module loaders
rem # This is necessary to inject Byteman rules into AS7 deployments
set "JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman"

REM NEW LINE HERE Alter Port Settings Offset
set "JAVA_OPTS=%JAVA_OPTS% -Djboss.socket.binding.port-offset=1000"
granadaCoder
  • 21,474
  • 7
  • 81
  • 117
1

Change the socket-binding of http to your desire port number you want to use inside the socket-binding-group in your standalone.xml file of jboss.For example i am using 8090 as my port number.

<socket-binding name="http" port="8090"/>
1

Go to jboss directory exp - jboss-7.0.0.CR1\jboss-7.0.0.CR1\standalone\configuration

open standalone.xml file then change port number according to you.

enter image description here

Racil Hilan
  • 22,887
  • 12
  • 43
  • 49
0

In eclipse I open port-offset (that corrispondes to standalone.xml) and modify jboss.socket.binding.port-offset from 0 to 1000 enter image description here

Frizz1977
  • 912
  • 11
  • 19
0

To change the port for JBoss in local, when running multiple instances below are the steps.

  1. In the JBoss folder, go to standalone.xml.
  2. search for
  3. change the "port-offset=${jboss.socket.binding.port-offset:0} to 100 like below port-offset="${jboss.socket.binding.port-offset:100}
  4. Then when ran standalone.bat, then Jboss will run on port 10090
kranti
  • 69
  • 1
  • 6