<!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">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;">
    class loading of an inbound resource adapter?
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/kgrunert">Kai Grunert</a> in <i>IronJacamar</i> - <a href="http://community.jboss.org/message/623879#623879">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hello,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have just written an inbound resource adapter and everything seems to work fine with it. When I deploy my RA to the JBoss 7.0.1 AS, the container calls the ResourceAdapter.start(BootstrapContext ctx) method and I get a log message that the resource adapter has been started successfully. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>In the next step, I try to activate an endpoint for my MDB using the following annotations:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">...
<font color="navy"><b>import</b></font> de.RATest.UDPMessageListener;
&#160;
@MessageDriven(messageListenerInterface = UDPMessageListener.class,
&#160;&#160;&#160; activationConfig=<font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; @ActivationConfigProperty(propertyName = <font color="red">"port"</font>, propertyValue=<font color="red">"15660"</font>)
<font color="navy">}</font>)
<font color="navy"><b>public</b></font> <font color="navy"><b>class</b></font> UDPMessageDrivenBean <font color="navy"><b>implements</b></font> UDPMessageListener<font color="navy">{</font>
&#160;&#160;&#160; 
&#160;&#160;&#160;&#160; <font color="navy"><b>public</b></font> <font color="navy"><b>void</b></font> onMessage(String str)<font color="navy">{</font>
&#160;&#160;&#160;&#160;&#160;&#160;&#160; ...
&#160;&#160;&#160; <font color="navy">}</font>
<font color="navy">}</font>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Unfortunately when I deploy the MDB, I end up with a NoClassDefFoundError and ClassNotFoundException for the MessageListener Interface:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">23:56:30,367 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.subunit."MDB_RA_TEST.ear"."MDBs.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."MDB_RA_TEST.ear"."MDBs.war".INSTALL: Failed to process phase INSTALL of subdeployment "MDBs.war" of deployment "MDB_RA_TEST.ear"
&#160;&#160;&#160; at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121)
&#160;&#160;&#160; at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
&#160;&#160;&#160; at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
&#160;&#160;&#160; at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
&#160;&#160;&#160; at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
&#160;&#160;&#160; at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
Caused by: java.lang.LinkageError: Failed to link UDPMessageDrivenBean (Module "deployment.MDB_RA_TEST.ear.MDBs.war:main" from Service Module Loader)
&#160;&#160;&#160; at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:401)
&#160;&#160;&#160; at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:261)
&#160;&#160;&#160; at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:76)
&#160;&#160;&#160; at org.jboss.modules.Module.loadModuleClass(Module.java:588)
&#160;&#160;&#160; at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:183)
&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
&#160;&#160;&#160; at java.lang.Class.forName0(Native Method) [:1.6.0_26]
&#160;&#160;&#160; at java.lang.Class.forName(Class.java:247) [:1.6.0_26]
&#160;&#160;&#160; at org.jboss.as.ee.component.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:124)
&#160;&#160;&#160; at org.jboss.as.ee.component.EEClassConfigurationProcessor$1.compute(EEClassConfigurationProcessor.java:114)
&#160;&#160;&#160; at org.jboss.as.ee.component.LazyValue.get(LazyValue.java:40)
&#160;&#160;&#160; at org.jboss.as.ee.component.EEApplicationDescription.getClassConfiguration(EEApplicationDescription.java:183)
&#160;&#160;&#160; at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentDescription.createConfiguration(MessageDrivenComponentDescription.java:78)
&#160;&#160;&#160; at org.jboss.as.ee.component.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:63)
&#160;&#160;&#160; at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115)
&#160;&#160;&#160; ... 5 more
Caused by: java.lang.NoClassDefFoundError: de/RATest/UDPMessageListener
&#160;&#160;&#160; at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_26]
&#160;&#160;&#160; at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [:1.6.0_26]
&#160;&#160;&#160; at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [:1.6.0_26]
&#160;&#160;&#160; at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [:1.6.0_26]
&#160;&#160;&#160; at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:397)
&#160;&#160;&#160; ... 22 more
Caused by: java.lang.ClassNotFoundException: de.RATest.UDPMessageListener from [Module "deployment.MDB_RA_TEST.ear.MDBs.war:main" from Service Module Loader]
&#160;&#160;&#160; at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
&#160;&#160;&#160; at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
&#160;&#160;&#160; ... 27 more
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I'm relatively new in the Java EE world and have not a lot of experiences with resource adapters, but this exceptions seems to me that the classes of the .RAR-file are not loaded correctly. I have read&#160; parts of the specification and also tried a lot with different combinations of archives, for example:&#160; a standalone .rar and a .ejb-jar file, everything inside of an .ear-file and a lot of other combination - but nothing has worked. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I am actually not sure anymore, that&#160; the resource adapter is completely correct. I have some questions that maybe could solve my problem:</p><ul><li style="text-align: start;">do I need an JBoss specific deployment descriptor for the resource adapter? </li><li style="text-align: start;">do I have to modify the standalone-preview.xml also for an inbound resource adapter?</li><li style="text-align: start;">do I need something like the @ResourceAdapter annotation in my MDB?</li><li style="text-align: start;">if my&#160; inbound resource adapter is correct, should I see it in the management console under "Connector" -&gt; "Resource Adapters"?</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">Here are some more facts, that could be important:</p><ul><li style="text-align: start;">use of JCA 1.6</li><li style="text-align: start;">only annotations, so I have no ra.xml or ironjacamar.xml</li><li style="text-align: start;">I have started the standalone-preview.xml without any modifications</li><li style="text-align: start;">I have checked the RA with the ironjacamar validator and ended up with a "Validation successful"</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="text-align: start;">I have really no clue how to go on and hope that you can help me. To simplify matters I have attached the sources.</p></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/623879#623879">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in IronJacamar at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2098">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>