File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes JBoss + Amazon EC2 + IP Binding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss + Amazon EC2 + IP Binding" Watch "JBoss + Amazon EC2 + IP Binding" New topic

JBoss + Amazon EC2 + IP Binding

Marcus Gough

Joined: Apr 21, 2011
Posts: 1
Hi Ranchers,

Currently I run JBoss 6 on a dedicated server. Remote clients connect via EJB and all is well. To start the server, i run a command like: -b {{server ip address}}

The key here is that the server ip address must be set for the remote connections to work ( is no good).

I am keen to migrate my solution to Amazon EC2. I have managed to get setup, but unfortunatly I cannot start the JBoss server with the public (elastic) IP address binded as I would on a dedicated server. I have spent two days experimenting and googling to find a solution to my problem but without luck

Does anybody have any experience of overcoming this issue? Any pointers would be hugely appreciated.

Many Thanks,


Karthik Shiraly

Joined: Apr 04, 2009
Posts: 874

EC2 and elastic IP behaviour don't correspond exactly to that of a dedicated server with a static IP address.
In a regular dedicated/virtual server with static IP address, if you do an ifconfig, you'll see the static IP address in there.
But in EC2, you won't see the elastic IP.
That's because the elastic IP is never assigned to the instance, as a normal static IP would be.
EC2 uses NATting to map elastic IP to the private IP of EC2 instance it's currently bound to.
Since elastic IP is never assigned to the instance, you can't do -b <elasticIP>

Instead just execute with private IP or
1. -b <privateIP>
OR -b

2. The EC2 firewall should be configured to allow access to JNDI/RMI ports, etc.
For that, check which security group is applied for your instance (you can get this from AWS console when you select the instance)
In the sidebar "Security Groups" page, select this security group and add appropriate inbound rules for each port you want (JNDI and RMI are the only two needed, I guess...never tried remote EJB on EC2, just tried web server).

Now when your client accesses remote EJB on EC2, the routing will be
client --> elastic IP -> EC2 firewall -> EC2 NAT -> [Elastic IP to private IP] -> EC2 instance
Carrie Coy

Joined: May 23, 2011
Posts: 2
Which port numbers, specifically, need to be open on the EC2 firewall? I followed these instructions and opened ports 8080, 1098-1099, 4444-4445, 8009, 8083, and 8093 and I still can't connect to http://elastic-ip:8080... Jboss is running and bound to the private IP. Any tips on how to diagnose this?
Carrie Coy

Joined: May 23, 2011
Posts: 2
Sorry, I neglected the obvious. As soon as I opened outbound port 8080, I was able to connect.
I agree. Here's the link:
subject: JBoss + Amazon EC2 + IP Binding
It's not a secret anymore!