JBoss use different ports, e.g. for internal cluster communication or JMS, these ports are not configured and a free port will be used every restart.
Some ports are configured within jboss-service.xml (or others) and set to '0' which is the indicator for 'use a free port', in this case you might configure a fix port number.
Thanks for the reply.
Is there any way to know from where a particular port was opened? I tried doing Trace but didn't see anything related in the logs...
A bunch of ports are opened by JGroups to communicate within the cluster, you will find it via jmx-console section jboss.jgroups.
AFAIK only a JMS port is opened with a random number for temporary client-server communication.
But I'm not sure whether that is all.
Hi ! Thanks for the reply. The problem over here is that we need to install the JBoss on a customer site and the customer only unblocks the ports on the request basis. I tried chaging the jboss service xml as well but it only makes 1-2 ports static and others still remain random which is a problem with us.
Do you have the firewall between two JBoss instances which run in a cluster? Hopefully not, I think that is very difficult or unless impossible.
If the server (farm) is behind a firewall, you find helpful hints here:
If you have still questions you should post what services you use which are not working, what ports you configured within the firewall.
So it is easier two answer specific for the community.
There is only one jboss instance. We are not using in the cluster.
Also these are the ports that are already opened....
10081 -> Port opened by our application.
Now, when we block other ports, JBoss does not stay up and goes down with attached error...
What I want to know is if there is any way so we know why this port is opened and if this can be blocked, or if we can specify some range to the random ports that are opened by the jboss...
error.txt.zip 1.4 KB
If you have only one JBoss it should start on any system behind a firewall.
The 'java.io.IOException: Can not find a free port for use.' is a local problem that I don't understand ATM.
Do you check that a unchanged JBoss start correct after you unpack it?
How do you start the JBoss, please post command line?
What OS you use?
If the fresh JBoss didn't start without error please set the category 'org.jboss.remoting' to TRACE within the .../server/<server-conf>/conf/jboss-log4j.xml.
After startt you should attach the server.log and boot.log
We are using z/OS 1.12 to run JBoss. Now on this system, no application can open any port on its own other than the ports specified by the admin. See list above in my previous message. Also, there are no firewall issues on this system.
We are in the process of downloading the fresh JBoss with Teiid and will try to run it and get back to you with updates on it.
The command line that we use for starting the JBoss is
"+D org.jboss.Main -b <localhost>"
I'm not sure, but I suppose that not all JBoss ports can be set to a fixed port number because some are used for internal communication.
You should use the http://community.jboss.org/wiki/JBoss5xTuningSlimming wiki to remove all services (including cluster) from the JBoss to reduce the used ports.
Other option might be a virtual IP address where all ports are free.
Hi ! I checked yesterday and there are random ports to the tune of 36 that are opened and because of which, we just cannot install our application on customer system.
May be we can try taking the minimal JBoss and adding Teiid to it. Can you please tell me the dependencies required for Teiid and what all modules I need to add to JBoss to support Teiid. If there is any documentation for it, it will help us immensly...
We again tried this on a z/OS system where 60 ports were opened and it still gives the error
java.io.IOException: Can not find a free port for use.
We at present, just need to determine the max ports to open for running JBoss on a mainframe. This is because we install our application on a restricted environment where customer will open only the number of ports that we ask for. Now, for this, we opened 16 ports that we knew of and opened 45 ports extra to take care of the random ports that get opened by the JBoss internally.
Can you please take a look at that? I have attached the boot.log and the server log...
log.zip 60.3 KB
We also tried this by opening 1000 random ports for the JBoss...still JBoss dies with the previous error...
Has anybody tried running JBoss on port restricted environment before?
What profile you use?
i.e. JGroups use random ports for cluster communication.
Such ports should be open for internal communication and not opened for a firewall.