0 Replies Latest reply on Mar 31, 2010 7:45 PM by Tim Eakins

    Timeout Calling EJB from Remote Location

    Tim Eakins Newbie

      I'm really stuck on this one.  I can successfully run my webstart swing application which makes EJB 3.0 calls to my JBoss 5.1.0 server when I'm on the local network, but not when I'm outside.  In that case, I get timeouts and "Could not obtain connection to any of these urls: pf.servername.org:1099".  Full exception is toward the bottom.  Firewall is off.  All appropriate ports are forwarded.


      Even more confusing, I'm able to see the website that I've put the .jnlp and jarfiles on for downloading.  That works fine, jsp debugging output comes through on server.


      The logical layout is as follows

      Server                Router            Outside Domain            External Client    pf.servername.org        Any.IP  (DOESN'T WORK!!)


      Client (THIS WORKS!  Even when using pf.servername.org for all references!)



      At first I suspected blocked ports, but everything seems to be fine.  My server is as follows.  As mentioned above, I can run with all server references using pf.servername.org and it all works as expected.


      On the server
      Running my JBoss application 'pf', everything starts up without warnings or exceptions.  I see the EJBs no problem.


      Startup command:
      ./run.sh -b -c pf


      Ports Forwarded
          #     Name      Start Port     End Port      Server IP Address
          7     PF    8080    8080
          8     HTTPS    443    443
          9     RMI    8083    8083
          10    PFIC    1090    1099
          11    PFRMIC    4444    4444
          12    PFEJB    3873    3873
          13    bisocket    4457    4457


      Made sure no firewall


      # /etc/init.d/iptables stop
      iptables: Flushing firewall rules:                           OK 
      iptables: Setting chains to policy ACCEPT: filter            OK 
      iptables: Unloading modules:                                 OK 



      hosts is simple, but has reference


      # cat /etc/hosts
      # hostname viper added to /etc/hosts by anaconda   localhost localhost.localdomain localhost4 localhost4.localdomain4 viper
      ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 viper viper




      Any of the online port checkers say that 1099 is open.


      On the external client:


      After swing jar has downloaded via webstart and runs, output in console


      Logger.java:239: Failed to connect to pf.servername.org:1099
      javax.naming.CommunicationException:  Failed to connect to server pf.servername.org/68.xxx.45.160:1099 Root exception is
      javax.naming.ServiceUnavailableException: Failed to connect to server pf.servername.org/68.xxx.45.160:1099 Root exception is
      java.net.ConnectException: Connection timed out: connect
        at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:335)
        at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1734)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
        at javax.naming.InitialContext.lookup(Unknown Source)


      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server pf.servername.org/68.xxx.45.160:1099 Root exception is
      java.net.ConnectException: Connection timed out: connect
        at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:305)
        ... 17 more
      Caused by: java.net.ConnectException: Connection timed out: connect
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(Unknown Source)
        at java.net.PlainSocketImpl.connectTo(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.netSocket.connect(Unknown Source)




      ?:?: Unable to connect to remote. error=Could not obtain connection to any of these urls: pf.servername.org:1099



      So I'm really confused.  jars download, application comes up, but no EJB calls work.


      I should point out that even though my client works locally, I do get these "errors" that don't prohibit functionality.


      PFPersister is an EJB


      Logger.java:228: Couldn't handle invocation directly within org.jboss.ejb3.proxy.impl.handler.session.SessionRemoteProxyInvocationHandler@1526e3: Current invocation "public abstract java.lang.Object pfcommon.ejb.library.persist.PFPersisterInterface.queryForObject(java.lang.String,java.util.Map)" is not eligible for direct handling by org.jboss.ejb3.proxy.impl.handler.session.SessionRemoteProxyInvocationHandler@1526e3
      Logger.java:228: Received invocation request to method pfcommon.ejb.library.persist.PFPersisterInterfaceRemote: pfcommon.ejb.library.persist.PFPersisterInterface.queryForObject(java.lang.String,java.util.Map); using hash: 4728166201795524950
      Logger.java:228: SocketClientInvoker[4276fd, socket://] connecting
      Logger.java:228: SocketClientInvoker[4276fd, socket://] connected
      Logger.java:228: removed SocketClientInvoker[4276fd, socket://] from registry



      Searching groups for this hasn't yet shown what the problem is here.


      I've also tried putting @RemoteBinding entries as well with no luck.


      Any help, thoughts much appreciated!