Friday, June 06, 2008

Accessing JBoss server over the network

It is so easy to get started with jboss, but so difficult to customize it to do simple day to day stuff. For instance, you can start jboss by simply running the run.bat and access your fav Hello World or any other sample app at http://:/. Then you add a cool new feature and try to share this link with your colleague/friend/boss. Since you are smart, you change localhost with your local ip. Now you email the link and wait for appreciation. But what you end up getting is a reply that says: "this link doesn't work!" . Welcome to the world of jboss where you literally pay a price for using open source s.w. in form of time spend to find the right configuration.

By default jboss will accept all incoming requests if the domain name is localhost or ip 127.0.0.1. Anything other than this will throw a 404. There are two ways to get around this:
1. -b flag
When you run jboss, run it with the -b flag. Your command like might look something like this:
>run.bat -b 0.0.0.0
This will instruct jboss to accept incoming requests from any of its domain controller or ip addresses. You can also do ipconfig on your server box and specify the server's Ip address in place of 0.0.0.0.

2. jboss.bind.address
Above method will not work if you are running jboss as windows service. In that case you will have to explicitly configure this option in a property file.
locate the file: ...\default\conf\jndi.properties
Add the following line to it: jboss.bind.address=

Finally, you can check the jmx console to see if the changes are accepted!

0 Comments:

Post a Comment

<< Home