<!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="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">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;">
    Application ClassNotFound within InvocationHandler.invoke() on AS6 M2
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/fatbatman">fatbatman</a> in <i>JBoss Remoting</i> - <a href="http://community.jboss.org/message/535513#535513">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I'm in the process of upgrading the JBoss 6 M2 and I'm getting a ClassNotFound error within MyRemotingInvocationHandler.invoke(InvocationRequest invocation) when an applications class object is received by the server side invocation handler.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I create my connector programmatically using the code below on a socket transport.</p><p>The class is in the same application jar that the connector is created from, which is within deploy/myapp.ear/myapp.jar.</p><p>The connectors are created when the application is started as an mbean from deploy/myapp.ear/myserver-service.xml</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>This worked fine on JBoss 4 &amp; 5 so I assume there's something different in the Class Loading from the remoting thread pool threads on JBoss 6 M2?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Does anyone have any suggestions?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks in advance</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>James</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Server side connector set up is;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">Map&lt;String, String&gt; connectorConfig = <font color="navy"><b>new</b></font> HashMap&lt;String, String&gt;();
connectorConfig.put(<font color="red">"callbackStore"</font>, <font color="red">"org.jboss.remoting.callback.BlockingCallbackStore"</font>);&#160;&#160;&#160;&#160;&#160;<font color="darkgreen">//will block the thread trying to send it if memory is low.</font>
connectorConfig.put(<font color="red">"return-exception"</font>,<font color="red">"true"</font>);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="darkgreen">//Make sure the original Exception is returned to client when using servlet</font>
connectorConfig.put(<font color="red">"numAcceptThreads"</font>, <font color="red">"20"</font>);
connectorConfig.put(<font color="red">"maxPoolSize"</font>, <font color="red">"500"</font>);
 
 
 
Map&lt;String, String&gt; locatorConfig = <font color="navy"><b>new</b></font> HashMap&lt;String, String&gt;();
locatorConfig.put(<font color="red">"force_remote"</font>, <font color="red">"true"</font>);
locatorConfig.put(<font color="red">"leasing"</font>, <font color="red">"true"</font>);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="darkgreen">//The client will establish a lease with the server so the server can check it's still connected</font>
locatorConfig.put(<font color="red">"lease_period"</font>, GlobalConstants.LEASE_PERIOD+<font color="red">""</font>);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="darkgreen">//The period in which the server check the client is still there</font>
 
 
String uri = protocol + <font color="red">"://"</font> + server + <font color="red">":"</font> + port + path;
 
ServerConfiguration serverConfig = <font color="navy"><b>new</b></font> ServerConfiguration(protocol);
serverConfig.setInvokerLocatorParameters(locatorConfig);
 
Connector connector1 = <font color="navy"><b>new</b></font> Connector(connectorConfig);
connector1.setInvokerLocator(uri);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="darkgreen">//new InvokerLocator(protocol, server, port, path, locatorConfig);</font>
connector1.setServerConfiguration(serverConfig);
connector1.setLeasePeriod(GlobalConstants.LEASE_PERIOD); 
connector1.create();
 
connector1.getServerInvoker().setMaxNumberOfOnewayThreads(100); 
connector1.getServerInvoker().setSerializationType(GlobalConstants.JBOSS_REMOTING_SERIALIZATION_TYPE);
 
MyRemotingInvocationHandler invocationHandler = <font color="navy"><b>new</b></font> MyRemotingInvocationHandler();
connector1.addInvocationHandler(MyConstants.REMOTING_SYSTEM, invocationHandler);
 
 
connector1.addConnectionListener(<font color="navy"><b>new</b></font> MyRemotingConnectionListener());
connector1.start();
&#160;
&#160;
</code></pre></div>

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


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

</div>

</body>
</html>