[jboss-user] [EJB 3.0] - Accessing EJB3s through a firewall

magnus.ahlander do-not-reply at jboss.com
Thu Jan 10 08:16:15 EST 2008


I have an instance of JBossAS running on an internal server behind an external server (firewall/router). The external server has port forwarding configured for ports 8080 (HTTP), 1098 and 1099 (JNDI) and 3873 (EJB3). I'm trying to access EJB3 through a Swing Client. However, I'm getting a timeout exeception, which reveals that ejb3s are accessed through ip of the internal server:

org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://<INTERNAL_SERVER_IP>:3873/]
  | 
I resolved this problem by configuring the following for all used EJB3 in jboss.xml:

<session>
  |     <ejb-name>TestBean</ejb-name>
  |     <remote-binding>
  |          <client-bind-url>socket://<EXTERNAL_SERVER_IP>:3873</client-bind-url>
  |     </remote-binding>
  | </session>

However, as this configuration is packet within the EAR file it is an ugly solution.

I wonder if it would be possible to configure this in jboss-server.xml of ejb3.deployer? Something like:

<attribute name="clientConnectAddress"><EXTERNAL_SERVER_IP></attribute>
  | <attribute name="clientConnectPort">3873</attribute>

I'm using JBossAS 4.2.1 GA. I have set -Djava.rmi.server.hostname=<EXTERNAL_SERVER_IP>. I'm starting JBossAS with -b 0.0.0.0.

Regards,

Magnus

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4118642#4118642

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4118642



More information about the jboss-user mailing list