<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Remote EJB stale connection? InvocationTargetException: Remoting connection channel has been closed
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/sumitsu">Branden Smith</a> in <i>JBoss AS 7 Development</i> - <a href="https://community.jboss.org/message/740042#740042">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>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:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">java.lang.reflect.<span style="color: #ff0000;"><strong>InvocationTargetException</strong></span></span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at java.lang.reflect.Method.invoke(Method.java:597)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at <span style="color: #808080;"><em>{client application}</em></span></span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at java.lang.reflect.Method.invoke(Method.java:597)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.rmi.transport.Transport$1.run(Transport.java:159)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at java.security.AccessController.doPrivileged(Native Method)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.rmi.transport.Transport.serviceCall(Transport.java:155)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at java.lang.Thread.run(Thread.java:619)</span></p><p style="padding-left: 30px;"><strong style="color: #800000; font-family: courier new,courier;">Caused by: java.lang.reflect.UndeclaredThrowableException</strong></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at $Proxy4.doTask(Unknown Source)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at </span><span style="color: #808080; font-family: courier new,courier;"><em>{client application}</em></span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; ... 23 more</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">Caused by: <span style="color: #ff0000;"><strong>java.io.IOException: Channel Channel ID abc6099f (outbound) of Remoting connection 00cb31d8 to null has been closed</strong></span></span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.ejb.client.remoting.ChannelAssociation$1.handleClose(ChannelAssociation.java:110)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.ejb.client.remoting.ChannelAssociation$1.handleClose(ChannelAssociation.java:102)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.remoting3.spi.SpiUtils.safeHandleClose(SpiUtils.java:54)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.remoting3.spi.AbstractHandleableCloseable$CloseHandlerTask.run(AbstractHandleableCloseable.java:501)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.remoting3.spi.AbstractHandleableCloseable.runCloseTask(AbstractHandleableCloseable.java:406)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeComplete(AbstractHandleableCloseable.java:277)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.remoting3.remote.RemoteConnectionChannel.closeAction(RemoteConnectionChannel.java:517)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:359)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.remoting3.remote.RemoteConnectionHandler.closeAllChannels(RemoteConnectionHandler.java:382)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.remoting3.remote.RemoteConnectionHandler.handleConnectionClose(RemoteConnectionHandler.java:103)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; at org.jboss.remoting3.remote.RemoteReadListener$1$1.run(RemoteReadListener.java:55)</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #800000;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; ... 3 more</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The client does not appear to automatically retry.&#160; Here is my current <strong>jboss-ejb-client.properties</strong> file:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #0000ff;">remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #0000ff;">remote.connections=default</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #0000ff;">remote.connection.default.host=<span style="color: #808080;"><em>{HOST}</em></span></span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #0000ff;">remote.connection.default.port=19000</span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #0000ff;">remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #0000ff;">remote.connection.default.username=<em style="color: #808080;">{username}</em></span></p><p style="padding-left: 30px;"><span style="font-family: courier new,courier; color: #0000ff;">remote.connection.default.password=<span style="color: #808080;"><em>{password}</em></span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I don't recall having seen a similar "stale connection" effect when remotely invoking EJBs under previous version of JBoss.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><ul><li style="text-align: start;">Have I incorrectly configured something, either for remoting on the server side, or on the client side?</li><li style="text-align: start;">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?</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">Thanks.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/740042#740042">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss AS 7 Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>