8 Replies Latest reply on Nov 7, 2012 9:48 AM by jaikiran pai

    Remote EJB stale connection? InvocationTargetException: Remoting connection channel has been closed

    Branden Smith Newbie

      I'm encountering the following client-side exception when I try to invoke an AS7-deployed EJB 3 SLSB after a period of idle time:

       

      java.lang.reflect.InvocationTargetException

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at {client application}

              at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)

              at sun.rmi.transport.Transport$1.run(Transport.java:159)

              at java.security.AccessController.doPrivileged(Native Method)

              at sun.rmi.transport.Transport.serviceCall(Transport.java:155)

              at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)

              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)

              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

              at java.lang.Thread.run(Thread.java:619)

      Caused by: java.lang.reflect.UndeclaredThrowableException

              at $Proxy4.doTask(Unknown Source)

              at {client application}

              ... 23 more

      Caused by: java.io.IOException: Channel Channel ID abc6099f (outbound) of Remoting connection 00cb31d8 to null has been closed

              at org.jboss.ejb.client.remoting.ChannelAssociation$1.handleClose(ChannelAssociation.java:110)

              at org.jboss.ejb.client.remoting.ChannelAssociation$1.handleClose(ChannelAssociation.java:102)

              at org.jboss.remoting3.spi.SpiUtils.safeHandleClose(SpiUtils.java:54)

              at org.jboss.remoting3.spi.AbstractHandleableCloseable$CloseHandlerTask.run(AbstractHandleableCloseable.java:501)

              at org.jboss.remoting3.spi.AbstractHandleableCloseable.runCloseTask(AbstractHandleableCloseable.java:406)

              at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeComplete(AbstractHandleableCloseable.java:277)

              at org.jboss.remoting3.remote.RemoteConnectionChannel.closeAction(RemoteConnectionChannel.java:517)

              at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:359)

              at org.jboss.remoting3.remote.RemoteConnectionHandler.closeAllChannels(RemoteConnectionHandler.java:382)

              at org.jboss.remoting3.remote.RemoteConnectionHandler.handleConnectionClose(RemoteConnectionHandler.java:103)

              at org.jboss.remoting3.remote.RemoteReadListener$1$1.run(RemoteReadListener.java:55)

              ... 3 more

       

      The client does not appear to automatically retry.  Here is my current jboss-ejb-client.properties file:

       

      remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

      remote.connections=default

       

      remote.connection.default.host={HOST}

      remote.connection.default.port=19000

      remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

       

      remote.connection.default.username={username}

      remote.connection.default.password={password}

       

      I don't recall having seen a similar "stale connection" effect when remotely invoking EJBs under previous version of JBoss.

       

      • Have I incorrectly configured something, either for remoting on the server side, or on the client side?
      • Is there anything I should do to make the AS7 EJB client handle this Exception internally, or do I just need to write client code to catch the InvocationTargetException and retry from there?

       

      Thanks.