1 Reply Latest reply on Jan 6, 2012 6:14 AM by Anup D

    Swing Client - EJB2 lookup over HTTP in JBoss 5.1

    Anup D Newbie

      I have a swing client which connects to my ejb2 application deployed in JBoss 5.1.

      There is a particular requirement from Customer to make it available on internet.


      The deployment architecture is as follows,

      swing_client --> extranet_ip |firewall | --> iis7_machine --> jboss5.1_machine.


      jndi properties in client is as follows,

      Context.PROVIDER_URL=http://extranet_ip:9180/invoker/JNDIFactory Context.INITIAL_CONTEXT_FACTORY=org.jboss.naming.HttpNamingContextFactory


      This configuration works fine when the client is inside intranet. But it does not work in internet (extranet).


      When I tried initially I got the error 'Connection refused'.

      After seeing some posts in various forums, I changed the file server\deploy\http-invoker.sar\META-INF\jboss-service.xml, to reflect the extranet_ip in invokerURL. Aftet this I am getting the following error,


      org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://]


      Where is the intranet IP address of JBoss Server machine.


      I tried changing the trasport parameter in remoting-jboss-beans.xml to http, but at that time client is not working in both intranet and extranet.


      Please anybody suggest a way forward for this issue. Or is there any other way to implement RMI over Http in JBoss?

        • 1. Re: Swing Client - EJB2 lookup over HTTP in JBoss 5.1
          Anup D Newbie

          As a solution, I had to change my deployment architecture as follows.


          swing_client --> extranet_ip |firewall | --> jboss5.1_machine


          where the JBoss Application Server will be directly exposed through firewall. Then update clientConnectAddress in the remoting-jboss-beans.xml to the extranet IP. Also open the ports 8080 & 4446 in the firewall for this address.


          This way the swing client is working if I use the jnid properties as follows.

          Context.PROVIDER_URL : http://extranet_ip:8080/invoker/JNDIFactory  
          Context.INITIAL_CONTEXT_FACTORY : org.jboss.naming.HttpNamingContextFactory


          But still looking for a solution where there is no need to open any non-standard ports and no need to expose the Application Server directly.

          1 of 1 people found this helpful