0 Replies Latest reply on Feb 19, 2014 8:16 AM by Newman Poborsky

    Resource Adapter and MDB deployment

    Newman Poborsky Newbie

      Hi!

       

      I have a problem deploying resource adapter and its endpoint (MDB) to Wildfly 8, I've been stuck with this for days now, so I kindly ask for help.

       

      So far I've created  the resource adapter and packaged it in a proper .rar file with structure identical to the one defined in Ironjacamar docs. I've deployed the adapter successfully to the server. And this is where I got stuck, cause I haven't been able to deploy message driven bean that uses interface defined in resource adapter.

       

      When I try to deploy my MDB to the server, I get "No message listener of type com.example.ra.inflow.AcmeMessageListener found in resource adapter ra-1.0-SNAPSHOT.rar".

       

      I've read that I'm supposed to activate my resource adapter in standalone.xml, but when I add:

      <resource-adapters>
        <resource-adapter>
          <archive>ra-1.0-SNAPSHOT.rar</archive>
          <transaction-support>NoTransaction</transaction-support>
        </resource-adapter>
      </resource-adapters>
      

       

      to server configuration, and try to deploy my resource adapter to the server I get and exception:

      "Caused by: org.jboss.msc.service.DuplicateServiceException: Service jboss.ra."ra-1.0-SNAPSHOT" is already registered"

       

      So, my questions are: What are the proper steps for deploying resource adapter and MDB to Wildfly 8?  What should I add to server configuration file? What am I missing? 

       

      Could somebody please explain what is necessary to get this scenario working?

       

      My MDB code is this:

       

      @MessageDriven
      public class MyMdb implements AcmeMessageListener {
          public MyMdb() {
          }
          @Override
          public void onMessage(String message) {
              //onMessage
          }
      }
      

       

      I even added ra.xml to my resource adapter, but that didn't help either.

      <?xml version="1.0" encoding="UTF-8"?>
      <connector xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
         http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd" version="1.5">
          <display-name>My EIS Connector</display-name>
          <vendor-name>TCOM</vendor-name>
          <eis-type>file</eis-type>
          <resourceadapter-version>2.0</resourceadapter-version>
          <resourceadapter>
              <resourceadapter-class>com.example.ra.AcmeResourceAdapter</resourceadapter-class>
              <inbound-resourceadapter>
                  <messageadapter>
                      <messagelistener>
                          <messagelistener-type>com.example.ra.inflow.AcmeMessageListener</messagelistener-type>
                          <activationspec>
                              <activationspec-class>com.example.ra.inflow.AcmeActivationSpec</activationspec-class>
                          </activationspec>
                      </messagelistener>
                  </messageadapter>
              </inbound-resourceadapter>
          </resourceadapter>
      </connector>
      

       

      Any help is appreciated! Thanks!