JBoss AS7 will not deploy when using different port

The JBoss AS7 Server can be set to change its port by going to the server configuration then under startup selecting to configure the Program Arguments and adding,

-Djboss.socket.binding.port-offset=808

The server starts but now the war and other artifacts will not deploy during server launch.  Also, the server does not shutdown, presumably for the same reason.  It would seem it is still trying to deploy to the default port for deployment which has been offset.  If, after the server is running happily on 8888 for example trying to deploy the war results in a message that the server is not connected.  I also tried setting the offset to 10 but same result.

Can someone please guide me as to how to get the deployment working?

Thanks

Nigel

6 comments
Comment actions Permalink

Hello,

IDEA does not parse VM-options, so it does not take "-Djboss.socket.binding.port-offset=100" into account when evalutates JBoss port numbers.



We are going to add dedication option to the IDEA run configuration, so you will be able to specify the port offset number (if needed) and IDEA will produce corresponding VM-option.
You may track http://youtrack.jetbrains.com/issue/IDEA-83449 for progress.


Regards,

Michael
0
Comment actions Permalink

Thanks for your reply.

This means that the only port I can start a server on and then successfully deploy is 8080.

If I change the server port to 8090 for example is there a workaround that will allow me configure it to port 8090 for deployment even if it is not pretty.

My issue is that I am running 2 servers, an AS7 and a SOA 5 server on the same PC so they cannot be on the same port.

Thanks

Nigel

0
Comment actions Permalink

Hello,

Actually, IDEA supports JBoss 7 ports configuration in <JBoss home>/standalone/configuration/standalone.xml under

socket-binding-group node.
XPath for the http port number is /socket-binding-group/socket-binding[@name='http]/@port


Regards,
Michael
0
Comment actions Permalink

Hi,

Again thanks for the reply.

I can start the server on the port I want without issue as you say. My issue is that IntelliJ will not deploy to the running server as it is still trying to deploy to the port 8080. So I get a running server with no deployed artifacts. The best I can do currently is build it in IntelliJ and then pick up the war file and deploy that to the deployment directory on the server.  The server picks it up and all works. This process works but is not as nice as the cool process when using 8080.

My thought is you will need to do a fix to this as many teams use common servers to deploy to and use the port to differentiate.

Thanks

Nigel

0
Comment actions Permalink

There is probably a missunderstanding...
I'm trying to say:
if you configure http port number in the standalone.xml to the a different from the default number, say to 8090 (so the file will contain ...<socket-binding name="http" port="8090"/>... )
then JBoss 7 will start on 8090, and IDEA will read the JBoss configuration and will connect to 8090.

Does this work for you?

If not, please provide:
1) your standalone.xml
2) screenshot of the IDEA JBoss run configuration
3) content of the Output tab of the running IDEA JBoss run configuration

Please note, IDEA uses 2 port numbers from the standalone.xml :
1) http port (/socket-binding-group/socket-binding[@name='http']/@port)

- this one is used to check if JBoss server is up and to produce urls of deployed apps.
2) management port (/socket-binding-group/socket-binding[@name='management-native']/@port)
- this one is used to connect to the management interface and perform apps deployment.


Another question, is that at the moment, IDEA does not support any JBoss 7-specific VM options which may modify the port numbers.
So if, for instance, you will specify -Djboss.socket.binding.port-offset=808 as the VM option, IDEA will not add 808 to the http port number from the standalone.xml and will not connect to the JBoss.

0
Comment actions Permalink

Hi,

I have marked your reply as the correct answer.  But I will give a bit more explanation as it needed a bit of work.

Your parser clearly reads the fields you have described and if I setup 8081 and 10000 for the two ports of interest it works.  Well not in all cases.  In my case I am using standalone-full-ha.xml to get EJB 3.1 etc so I had to carry on running that but change my un-used standalone.xml so that intellij could know what to do.  Also, I was not able to use any runtime replacement as the intellij does not run in my Jboss runtime.

Anyway, clunky but working, thanks.

Can I suggest trying to read the configuration at runtime from the native management interface(of course you do need at least the management port).  I have not tryed to do this but it would seem that the information must be there(twiddle for example).  Doing that the user can fiddle however they want and Intellij can follow as soon as the managment interface is available to read, you would never get it wrong in that case.  You could also give two versions of deploy the "we read this file for binding" and "we wait until the managment console tells us what is the correct binding", that is if it is much of a performance hit to interogate the managment console.  If it is at least possible to change the config file to read for binding I could change mine to point at my standalone-full-ha.xml.

Anyway, thanks again

Nigel

1

Please sign in to leave a comment.