Enterprise Java

JBoss AS 7.0.2 “Arc” released – Playing with bind options

More good news on the JBoss AS7 front. JBoss AS 7.0.2.Final “Arc” has been released! It’s been one month since AS 7.0.1 was released.

Within this short period of time there have been numerous bugs fixed and more features and improvements implemented. All these bug fixes and features have been included in this 7.0.2 release.

This new release mainly consists of the following features/improvements:

  • JSF 2.1 Async
  • EJB support
  • Resurrected -b option for command line binding
  • SSO support
  • JNDI memory footprint improvement
  • Limited support for Hibernate 3.3

Let’s quickly look at one of these improvements. Those of you who have been using previous versions of JBoss AS would know that starting JBoss AS 4.2.x, JBoss by default binds its services to localhost for security reasons. These previous versions of JBoss AS allowed a command line option “-b” to allow binding the services to a different IP. AS 7.0.0 and 7.0.1 did not have this feature. Users could still bind to an IP of their choice but that required editing a xml file. Starting 7.0.2 release, we have now enabled this -b option (and also introduced a “-bmanagement” option) to allow you to bind your server to a IP/host of your choice. So let’s quickly see how it’s done.

Download the server binary from here and extract it to a folder of your choice. Start the standalone server using the standalone.sh (standalone.bat for Windows OS) script available in JBOSS_HOME/bin folder:

 jpai@jpai-laptop:bin$ ./standalone.sh  
 ...  
 18:45:36,893 INFO [org.jboss.as.remoting] (MSC service thread 1-3) Listening on /127.0.0.1:9999  
 18:45:37,030 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-4) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080  

In the logs you’ll notice that the server is being bound to 127.0.0.1 IP (by default). What this means is that all your services including the web access won’t be accessible remotely from a different machine via the IP address or hostname of your machine.

As a quick check, access the following pages:

http://localhost:8080
http://localhost:9990

The first one is the default home page of your server and the second URL is the admin console. Now try accessing them using your machine’s IP or hostname instead of localhost and you’ll notice that they aren’t accessible. Now let’s see how we can enable access via your machine’s IP or hostname.

Stop your running server and start it with the following command:

 jpai@jpai-laptop:bin$ ./standalone.sh -b 10.67.2.193  
 ...  
 18:47:24,588 INFO [org.jboss.as.remoting] (MSC service thread 1-1) Listening on /127.0.0.1:9999  
 18:47:24,818 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Starting Coyote HTTP/1.1 on http--10.67.2.193-8080  

Now you’ll notice that the http interface (for your web applications) is now bound to 10.67.2.193 (the IP you passed). However, the management interface (on which the admin console is exposed) still binds to localhost. So now, you’ll be able to access the AS home page (and your applications) at http://10.67.2.193:8080 and the admin console at http://localhost:9990

If you want to change the binding address for your management interface too, then you’ll have to additionally use the -bmanagement option as follows:

 jpai@jpai-laptop:bin$ ./standalone.sh -b 10.67.2.193 -bmanagement 10.67.2.193  
 ...  
 18:48:56,295 INFO [org.jboss.as.remoting] (MSC service thread 1-2) Listening on /10.67.2.193:9999  
 18:48:56,654 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http--10.67.2.193-8080  

As you can see the http interface and the management interface are now both bound to the IP address that you passed as a option to the startup script. So you’ll now be able to access the home page at http://10.67.2.193:8080 and the admin console at http://10.67.2.193:9990. That’s it!

So go get a fresh copy of 7.0.2 and start using it. If you run into any issues are have any suggestions, feel free to report them in our user forum.

Reference: JBoss AS 7.0.2 “Arc” released! from our JCG partner Jaikirian at “Jaitech WriteUps” blog.

Related Articles :

Jaikiran Pai

Jaikiran works for Red Hat and is a developer in the JBoss application server development team. He's one of the authors of "JBoss AS Getting Started" DZone RefCard. When he's not doing anything JBoss related, you can usually find him at JavaRanch, in his role as a Sheriff(Moderator). He blogs at jaitechwriteups
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Back to top button