aspose file tools*
The moose likes JBoss/WildFly and the fly likes Change JBoss Port No Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Reply locked New topic
Author

Change JBoss Port No

RoshaniG Gopal
Ranch Hand

Joined: May 15, 2006
Posts: 180
Hi all,
I want to change the port number of Jboss from 8080 to some other as I have oracle tnslistener on the same port no.
I have tried to change it following way, but it stills shows the error
server port in use 8080-http.
1) \jboss-4.0.3\server\deploy\jbossweb-tomcat55.sar\server.xml
<!-- A HTTP/1.1 Connector on port 8080 -->
<Connector port="8088" address="${jboss.bind.address}"
maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
emptySessionPath="true"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"/>
2) \jboss-4.0.3\server\deploy\http-invoker.sar\META-INF\jboss-service.xml
changed all 8080 to 8088.

But its not working Please help.


Regards,<br />Roshani
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

<!-- A HTTP/1.1 Connector on port 8080 -->
<Connector port="8088" address="${jboss.bind.address}"
maxThreads="250" strategy="ms" maxHttpHeaderSize="8192"
emptySessionPath="true"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"/>

That is all you need to change to change it from 8080 to another port. Maybe 8088 is also being used.

your change to the jboss-service.xml only affects the URL to use to use the HttpInvoker, which most people don't use anyway. It will not set JBoss to listen to a particular port.

You can also lookup the ServiceBinding Manager (at JBoss's website) to see how you can set a bunch of port numbers in a cleaner way than going into many different configuration files, but the server.xml is the only place that sets up 8080 as the Tomcat port number for Http.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
RoshaniG Gopal
Ranch Hand

Joined: May 15, 2006
Posts: 180
Thanks Mark for your inputs.
I have a customized Eclipse that uses Jboss as a plugin. I have already changed the port, but in Eclipse, it gives error about the 8080 port (it is in use inspite that server.xml has port 8088 defined for http). In external browser it opens Jboss console at the port specified in server.xml (here=8088).
Is it like there are some internal refernces to that port no? I still have the problem. I have though uninstalled the Oracle server and put it elsewhere for the time being, but i want to know the answer.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Unfortunately, I do not use Eclipse, or try to avoid is as much as possible. But it could just be that the server that Eclipse starts up is no the server that you are changing. It might have its own installation of JBoss within its directory. Or maybe you change the all configuration and Eclipse uses the default server configuration.

Mark
RoshaniG Gopal
Ranch Hand

Joined: May 15, 2006
Posts: 180
Thanks Mark.
The client has clarified that the Jboss port settings are done in the Eclipse configuration. So changing the port in server.xml would effect the instance of Jboss http listener (the reason why it was avialable in external browser).
Secondly we are working on how to change that port as that is not recommended.
Thanks once again for your insight.
Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
Originally posted by Mark Spritzler:
Unfortunately, I do not use Eclipse, or try to avoid is as much as possible.
Mark


Mark,

Why do you avoid eclipse? Any bad experience?
I use eclipse since long and it's nice IDE?

Vishal Pandya
isha krishnan
Ranch Hand

Joined: Nov 10, 2008
Posts: 50
hi roshni,

as you have discussed,i also have done changes in server.xml that are not sufficient.
could you please tell me that in eclipse cofiguration , where specifically the changes should be done..In which files?

Thanks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

In Eclipse 3.4.x, look at eclipse/plugins/org.eclipse.jst.server.generic.jboss_1.5.206.v20090115/servers. This directory contains config files for various versions of JBoss AS. The ports used by Eclipse to communicate with Boss AS are located in those files - change those ports to the same values you used in the JBoss AS config files.

If you are not using Eclipse 3.4.x, search for files named jboss*.serverdef


JBoss In Action
isha krishnan
Ranch Hand

Joined: Nov 10, 2008
Posts: 50
i have tried to change port in jboss5.serverdef file as below:



also have done changes in the server.xml of jboss as below:

but its not working..
console output is

09:31:08,375 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console, vfsUrl=jmx-console.war
09:31:08,453 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
09:31:08,468 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
09:31:08,468 INFO [ServerImpl] JBoss (Microcontainer) [5.0.0.CR2 (build: SVNTag=JBoss_5_0_0_CR2 date=200809171139)] Started in 36s:984ms

but after few seconds, error pop up saying ,server could not start in specified time . have tried to increase timeoutof server but it didn't work.
configuartion is JBoss 5.0 n eclipse 3.4.1
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

Do not change the server.xml file - thep roper way to change the ports used by JBoss AS 5.0.x (or 5.1.x) is to edit the server/xxx/conf/bootstrap/bindings.xml file. (Based on the log entries you posted, I suspect that you edited the wrong server.xml file.)

To change the ports that Eclipse uses to monitor JBoss AS (for example, to tell when it has started, and to shut it down), modify the jboss5.serverdef file.

Both files must agree as to the ports used or else Eclipse cannot determine if the app server has started, and will be unable to stop the app server.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

coolcapri amd, please check you private messages for an important administrative matter.
isha krishnan
Ranch Hand

Joined: Nov 10, 2008
Posts: 50
Thanks Peter

As you told, i changed bindings.xml by changing the default port and did the same in jboss5.serverdef file.
It has started running successfully.

Praveen Munagapaty
Greenhorn

Joined: Mar 28, 2010
Posts: 3
Isha,

I am using JBOSS 6.0.0. I am new to this server. I didnot find the respective folders as in the thread. But by carefully observing I found a different folder structure and when the changes are made, they are being reflected. i am unable to change the port of the server. Please help me out

..\jboss-6.0.0.M2\jboss-6.0.0.20100216-M2\server\default\deploy\bindings-jboss-beans.xml - binding.xml
..\eclipse-jee-galileo-SR2-win32\eclipse\plugins\org.eclipse.jst.server.generic.jboss_1.6.1.v200904151730\servers\jboss5.serverdef - jboss5.serverdef

Thanks in advance
Praveen
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10052
    
163

Praveen Munagapaty wrote:

..\jboss-6.0.0.M2\jboss-6.0.0.20100216-M2\server\default\deploy\bindings-jboss-beans.xml


You actually have that file there? It seems incorrect. For 6.0.0 M2 that file is still in JBOSS_HOME/server/< servername>/conf/bindingservice.beans/META-INF/bindings-jboss-beans.xml

[My Blog] [JavaRanch Journal]
Praveen Munagapaty
Greenhorn

Joined: Mar 28, 2010
Posts: 3
jboss-6.0.0.M2\jboss-6.0.0.20100216-M2\server\jbossweb-standalone\conf\bindingservice.beans\META-INF

Do <server-name> stand for jbossweb-standalone as I find only tht folder other than all, default, minimum, standard. If so the changes in that xml didn't turn out.

Can you please eloborate and help me

Thanks in advance
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10052
    
163

Praveen Munagapaty wrote:

Do <server-name> stand for jbossweb-standalone as I find only tht folder other than all, default, minimum, standard. If so the changes in that xml didn't turn out.



The < servername> in my post, stands for the server profile you are using? Usually it's the "default" one. Which one are you using? How do you start the server?
Praveen Munagapaty
Greenhorn

Joined: Mar 28, 2010
Posts: 3
I have published my server on eclipse and I run the server using the eclipse itself. Please let me know if I am doing some thing wrong.

The changes made in the .xml file located in the default folder didnt turn out.

Process i am following for changing the port:
Changed in jboss-6.0.0.20100216-M2\server\default\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml from 8080 to 8088
Changed in plugins\org.eclipse.jst.server.generic.jboss_1.6.1.v200904151730\servers\jboss5.serverdef from 8080 to 8088
Restarting the server

Still the server is working on the same port 8080. Can you please help me.

Thanks in advance
gourav chouhan
Ranch Hand

Joined: Apr 02, 2010
Posts: 74
hi
To change port number from 8080 to something else.you need to change the port number from server.xml file. Now location of server.xml file is C:\jboss-5.0.0.GA\server\default\deploy\jbossweb.sar if Jboss is installed in c drive. Then remove jboss from netbeans and again add to netbeans...Now it will show the changed port.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

gourav chouhan wrote:hi
To change port number from 8080 to something else.you need to change the port number from server.xml file. Now location of server.xml file is C:\jboss-5.0.0.GA\server\default\deploy\jbossweb.sar if Jboss is installed in c drive. Then remove jboss from netbeans and again add to netbeans...Now it will show the changed port.

Gourav, two points:
a) Changing the port number in server.xml is not the right thing to do (see my earlier post)
b) You provide a location in JBoss AS 5. You are aware that this current discussion is about JBoss AS 6, right?
gourav chouhan
Ranch Hand

Joined: Apr 02, 2010
Posts: 74
Peter Johnson wrote:
gourav chouhan wrote:hi
To change port number from 8080 to something else.you need to change the port number from server.xml file. Now location of server.xml file is C:\jboss-5.0.0.GA\server\default\deploy\jbossweb.sar if Jboss is installed in c drive. Then remove jboss from netbeans and again add to netbeans...Now it will show the changed port.

Gourav, two points:
a) Changing the port number in server.xml is not the right thing to do (see my earlier post)
b) You provide a location in JBoss AS 5. You are aware that this current discussion is about JBoss AS 6, right?


I m working with jboss 5.0 n netbean6.7 and i changed the port no. in server.xml file its working... but if it is not the right way then can you please give me correct way
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10052
    
163

gourav chouhan wrote:
but if it is not the right way then can you please give me correct way


Earlier in this thread http://www.coderanch.com/t/90547/JBoss/Change-JBoss-Port-No#1979930
praneel shah
Greenhorn

Joined: Mar 16, 2010
Posts: 17
use 8090 port no
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10052
    
163

praneel shah wrote:use 8090 port no


Why?
Kalyan Kamepalli
Greenhorn

Joined: Mar 01, 2009
Posts: 14
Peter Johnson wrote:Do not change the server.xml file - thep roper way to change the ports used by JBoss AS 5.0.x (or 5.1.x) is to edit the server/xxx/conf/bootstrap/bindings.xml file. (Based on the log entries you posted, I suspect that you edited the wrong server.xml file.)

To change the ports that Eclipse uses to monitor JBoss AS (for example, to tell when it has started, and to shut it down), modify the jboss5.serverdef file.

Both files must agree as to the ports used or else Eclipse cannot determine if the app server has started, and will be unable to stop the app server.


Hi Peter,

I use JBOSS 4.0.3SP1 and I changed server.xml to new port and it worked fine. from your posts, I can see that
that's not the rite way to do it. As you said, I tried to find serverdef. But, I couldn't find it. What would be the reason
for that ? Is there a serverdef file in 4.0.3SP1 ??

BTW, I do not use any IDEs. I start server from run command.

I don't have any issues with AS working with that change in server.xml. But, I want to know the proper way to do it.

Cheers,
Kalyan



Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10052
    
163

Kalyan Kamepalli wrote:
I use JBOSS 4.0.3SP1 and I changed server.xml to new port and it worked fine. from your posts, I can see that
that's not the rite way to do it. As you said, I tried to find serverdef. But, I couldn't find it. What would be the reason
for that ? Is there a serverdef file in 4.0.3SP1 ??

BTW, I do not use any IDEs. I start server from run command.

The serverdef file is for IDEs (as already mentioned by Peter in his reply). Since you don't use IDEs, you don't have to worry about that file.


I don't have any issues with AS working with that change in server.xml. But, I want to know the proper way to do it.



The right way to do this, is to use the Service binding manager. For 4.x see this documentation.

P.S: Please do not use font colours while posting.
Kalyan Kamepalli
Greenhorn

Joined: Mar 01, 2009
Posts: 14
Jaikiran Pai wrote:
Kalyan Kamepalli wrote:
I use JBOSS 4.0.3SP1 and I changed server.xml to new port and it worked fine. from your posts, I can see that
that's not the rite way to do it. As you said, I tried to find serverdef. But, I couldn't find it. What would be the reason
for that ? Is there a serverdef file in 4.0.3SP1 ??

BTW, I do not use any IDEs. I start server from run command.

The serverdef file is for IDEs (as already mentioned by Peter in his reply). Since you don't use IDEs, you don't have to worry about that file.


I don't have any issues with AS working with that change in server.xml. But, I want to know the proper way to do it.



The right way to do this, is to use the Service binding manager. For 4.x see this documentation.

P.S: Please do not use font colours while posting.



I couldn't find any bindings file in my setup. Actually, I did find one "sample-bindings.xml" file.But, this is in example folder of the setup.
Could some one help me to find the actual binding file please. I use JBOSS 4.0.3SP1.

Should I change the bindings file even if I don't use multiple instances on AS ???
All I wanted to do is changing the default port from 8080 to a different one.

Thanks,
Kalyan.

Wander Soares
Greenhorn

Joined: Jun 18, 2010
Posts: 10
Hi i´m new using jboss.Can you show me,exactly where in the \jboss-6.0.0.20100429-M3\server\default\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml i have to modify to the port i want?In my case i´m trying to use 8082.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

"Wander Soares", please see your private messages for an important administrative matter.

Did you try searching for the string "8080" and changing it to "8082"?
Wander Soares
Greenhorn

Joined: Jun 18, 2010
Posts: 10
Peter Johnson wrote:"Wander Soares", please see your private messages for an important administrative matter.

Did you try searching for the string "8080" and changing it to "8082"?


I tried it, i only found one unique "8080",but that does not seem to be the right one.

<bean class="org.jboss.services.binding.ServiceBindingMetadata">
<property name="serviceName">jboss.web:service=WebServer</property>
<property name="bindingName">HttpConnector</property>
<property name="port">8080</property>
<property name="description">JBoss Web HTTP connector socket; also drives the values for the HTTPS and AJP sockets</property>
</bean>

I tried that one, but anythig changes!
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

I repeat my request that you read your private messages.
Debmalya Jash
Greenhorn

Joined: Oct 07, 2002
Posts: 1
I changed port 8080 to 28080 in the following files. It is working now. C:\jboss-6.0.0.M1 is my JBOSS_HOME
C:\jboss-6.0.0.M1\server\all\deploy\jbossweb.sar\server.xml
C:\jboss-6.0.0.M1\server\default\deploy\jbossweb.sar\server.xml
C:\jboss-6.0.0.M1\server\standard\deploy\jbossweb.sar\server.xml
C:\jboss-6.0.0.M1\server\web\deploy\jbossweb.sar\server.xml
C:\jboss-6.0.0.M1\server\all\conf\bindingservice.beans\META-INF\bindings-jboss-beans.xml
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10052
    
163

I'm going to close this thread now. This thread is creating more confusion by suggesting changes to various files of various different versions of the AS. If anyone has a specific question related to this please create a separate thread.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Change JBoss Port No