I am confused about the meaning of launching JBoss 7 with the -b=nnn.nnn.nnn.nnn option.
I know that if we want the server to respond to "remote" accesses (i.e., from other than localhost) we have to launch with the -b=nnn.nnn.nnn.nnn option (such as "standalone.bat -b=nnn.nnn.nnn.nnn"). However, I don't understand why this is necessary.
I am coming to the use of JBoss from a prior use of Tomcat. With Tomcat we can specify a port that Tomcat is to listen on and if a remote system directs a query to the IP address of the machine running Tomcat (on the right port) Tomcat responds to the query. I can understand the idea of having a switch that tells JBoss if it should ignore or respond to a remote request but the -b=nnn.nnn.nnn.nnn option would appear to do more than that. As I understand, this tells JBoss to respond to queries directed at the specifc IP address represented by "nnn.nnn.nnn.nnn". My question is "what other IP address would it respond to other than the IP address of the machine where it is running?" Does this option mean that if JBoss is running on a machine @ 123.456.789.001 we can launch it with -b=999.999.999.111 and it would (only) respond to queries direct to 999.999.999.111? That is, a query of 999.999.999.111:nnnnn/servletname/... would trigger a response? If not, then why the form -b=nnn.nnn.nnn.nnn? On the other hand, if we can, what in the world does that even mean?
In a related question, what does -b=0.0.0.0 mean?
What are the use cases for 0.0.0.0 and for using -b with an IP address other than the machine where JBoss is running?
Thanks for your reply! I have learned that an machine can have multiple IP addresses (something I had forgotten!) so this now makes sense. Thanks for your link which led to your blog post - that is helpful info.
Perhaps you can answer this follow on question. I am running JBoss on Windows server 2008R2 on an Amazon AWS instance. If I start with standalone -b=0.0.0.0 I can access the server. However, if I start with standalone -b=aaa.bbb.ccc.ddd where aaa.bbb.ccc.ddd is the Public IP address assigned to the AWS instance the server crashes on start up with
11:48:54,459 INFO [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
11:48:54,475 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread1-1) JBAS015012: Started FileSystemDeploymentService for directory C:\jboss-as-7
.1.1.Final\standalone\deployments11:49:00,403 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774
: Service status reportJBAS014777: Services which failed to start: service jboss.network.public: org.jboss.msc.service.StartException in service jboss.network.public: JBAS015810: failed to resolve interface public
11:49:00,419 INFO [org.jboss.as] (Controller Boot Thread) JBAS015954: Admin console is not enabled
11:49:00,419 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS7.1.1.Final "Brontes" started (with errors) in 9142ms - Started 119 of 214 services (44 services failed or missing dependencies, 49 services are passive or on-demand)
>>> Note the error: JBAS015810: failed to resolve interface public.
The IP address is the only difference. Can you help me find the problem? Thanks again very much!
Thanks for your ongoing response - I appreciate your help.
This is a valid IP - it is an "Elastic IP" that is a public IP address created by AWS that I associate with the AWS instance running JBoss. If I launch with standalone.bat -b=0.0.0.0 I can connect instantly with http://elasticipaddress:8080. However, if I launch with standalone.bat -b=elasticipaddress I get the "interface public" error I described in my initial post and http://elasticipaddress:8080 just times out.
(I have the Windows Server 2008 Firewall completely turned off in all of these tests.)
I have also tested the above cases (after enabling and starting the telnet server on Server 2008) with telnet elasticipaddress and I can connect so all of this indicates that the elasticipaddress is correct and seems "normal". (Just FYI, an AWS instance is completely "locked down" to start with so I have to always modify the Security Group settings to explicitly allow a particular type of access. However, I don't see how that could in any way trigger the JBoss server throwing an error on start up when I use standalone.bat -b=elasticipaddress.)
Also, since I had initially made some port assignment changes and had set up a manged data source I refreshed the whole JBoss configuration folder with the original from the installation. Unfortunately, this "fresh" configuration made no difference.
Note that I have installed JBoss 7 on my LAN and can launch it with -b= specific IP address and we have no error on launch and can connect. This makes me start to wonder if there is something "strange" about the AWS Elastic IP address. It is described by Amazon as just a "normal" public IP address and that seems true in all regards - as I said, I can connect (when I launch with -b=0.0.0.0) and can telnet with no problems - but could JBoss's use in the -b option perhaps fail because of something "strange" since it's an Elastic IP? I am sure many other people are running JBoss on an AWS instance (however, this is Server 2008 and not Linux).
Use the ipconfig command to check the IP address(es) for your instance. It may be that the instance has a private IP, and that traffic directed to the public IP (elasticipaddress) is NAT'ed by Amazon to your instance's private IP. If that is the case, you will need to specify the private IP on the command line, not the public IP.
That was the problem Ron! When I launch with -b=privateipaddress we launch with no errors but we access with http://elasticipaddress:port. As you speculated, they must be NAT'ing the elasicipaddress to point to the "real" (private) IP address that we bind JBoss to.