users@glassfish.java.net

SOLVED: Glassfish, VirtualBox, NAT, rich client using EJB, JMS - bad ports

From: <glassfish_at_javadesktop.org>
Date: Wed, 24 Dec 2008 08:36:04 PST

I've just figured out how to "lock" the port that imq uses for JMS to a particular value, and hence get this working in a predictable manner in my NAT configuration.

The file[b] {DOMAINDIR}/imq/instances/imqbroker/props/config.properties[/b] lists out the possible things that can be changed for IMQ.

The key is that 2037 is IMQ's "portmapper" process - not the *real* JMS port at all.

Once I'd realised this, examined the logs again for the umpteenth time, I noticed this message and finally understood what it was saying:

[24/Dec/2008:16:29:26 GMT] [B1004]: Starting the jms service using tcp(host = *, port=0, mode=dedicated) with min threads 10 and max threads of 1000

So I added this property to config.properties:
imq.jms.tcp.port=2077
and mapped port 2077 through my NAT configuration from my "client" machine back to the Glassfish server running inside VirtualBox. Et voila! Now when IMQ starts:

[24/Dec/2008:16:31:26 GMT] [B1004]: Starting the jms service using tcp(host = *, port=2077, mode=dedicated) with min threads 10 and max threads of 1000

Since the server is now listening on a predictable port, the NAT configuration is stable, and clients can now connect and send JMS messages.
[Message sent by forum member 'edrandall' (edrandall)]

http://forums.java.net/jive/thread.jspa?messageID=323221