1 Reply Latest reply on May 2, 2006 4:11 PM by Juha Moisio

    EJB3 MDBs  & JCA 1.5

    Juha Moisio Newbie

      Hi,

      I have Sonic Sortware's SonicMQ JCA Adapter for JBoss 4.x
      It worked just fine with EJB 2 MDBs.

      Now I'm trying to convert MBDs to EJB3 and all
      I'm getting is DefaultJMSProvider not bound.
      I have moved all activation configs to Annotations.

      What I'm missing here?

      I'm using JBoss 4.0.4CR2.

      Here is configurations from EJB 2.

       <!-- ejb-jar.xml -->
       <message-driven >
       <display-name>Message Driven Listener Bean</display-name>
      
       <ejb-name>ESBListener</ejb-name>
       <ejb-class>fi.logiasoftware.messageservices.backend.ESBListenerBean</ejb-class>
      
       <messaging-type>javax.jms.MessageListener</messaging-type>
       <transaction-type>Container</transaction-type>
       <message-destination-type>javax.jms.Queue</message-destination-type>
       <activation-config>
       <activation-config-property>
       <activation-config-property-name>destinationType</activation-config-property-name>
       <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
       </activation-config-property>
       <activation-config-property>
       <activation-config-property-name>acknowledgeMode</activation-config-property-name>
       <activation-config-property-value>Auto-acknowledge</activation-config-property-value>
       </activation-config-property>
       <activation-config-property>
       <activation-config-property-name>subscriptionDurability</activation-config-property-name>
       <activation-config-property-value>NonDurable</activation-config-property-value>
       </activation-config-property>
       <activation-config-property>
       <activation-config-property-name>destination</activation-config-property-name>
       <activation-config-property-value><![CDATA[SonicJMS/Queues/fromESB]]></activation-config-property-value>
       </activation-config-property>
       </activation-config>
      
       </message-driven>
      

      
       <!-- JBoss.xml -->
       <message-driven>
       <ejb-name>ESBListener</ejb-name>
       <destination-jndi-name>SonicJMS/Queues/fromESB</destination-jndi-name>
       <resource-adapter-name>sonic-jms-ra.rar</resource-adapter-name>
       </message-driven>
      


      <!-- standardjboss.xml -->
      
       <invoker-proxy-binding>
       <name>message-driven-bean</name>
       <invoker-mbean>default</invoker-mbean>
       <proxy-factory>org.jboss.ejb3.plugins.inflow.JBossMessageEndpointFactory</proxy-factory>
       <proxy-factory-config>
      
       <activation-config>
       <activation-config-property>
       <activation-config-property-name>brokerURL</activation-config-property-name>
       <activation-config-property-value>tcp://localhost:2506</activation-config-property-value>
       </activation-config-property>
       <activation-config-property>
       <activation-config-property-name>username</activation-config-property-name>
       <activation-config-property-value>Administrator</activation-config-property-value>
       </activation-config-property>
       <activation-config-property>
       <activation-config-property-name>xxxxxxxx</activation-config-property-name>
       <activation-config-property-value>Administrator</activation-config-property-value>
       </activation-config-property>
       <activation-config-property>
       <activation-config-property-name>DebugLevel</activation-config-property-name>
       <activation-config-property-value>1</activation-config-property-value>
       </activation-config-property>
       </activation-config>
      
       <endpoint-interceptors>
       <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
       <interceptor>org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor</interceptor>
       <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>
       <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
       </endpoint-interceptors>
       </proxy-factory-config>
       </invoker-proxy-binding>
      
      



      /** My MDB converted to EJB3 **/
      package fi.logiasoftware.messageserver.services.backend;
      
      import java.io.UnsupportedEncodingException;
      import java.util.Collection;
      import java.util.Enumeration;
      import java.util.HashMap;
      import java.util.Iterator;
      import javax.annotation.EJB;
      import javax.annotation.Resource;
      import javax.ejb.ActivationConfigProperty;
      import javax.ejb.EJBException;
      import javax.ejb.MessageDriven;
      import javax.ejb.MessageDrivenContext;
      import javax.jms.JMSException;
      import javax.jms.Message;
      import javax.jms.MessageListener;
      import javax.jms.TextMessage;
      import javax.naming.NamingException;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;
      import javax.persistence.Query;
      import javax.xml.bind.JAXBException;
      import org.apache.log4j.Logger;
      import fi.logiasoftware.messageserver.config.Chain;
      import fi.logiasoftware.messageserver.config.Chainstep;
      import fi.logiasoftware.messageserver.config.Destination;
      import fi.logiasoftware.messageserver.config.Endpoint;
      import fi.logiasoftware.messageserver.services.common.MessageEnvelope;
      import fi.logiasoftware.messageserver.services.handlers.DirectoryInfoImpl;
      import fi.logiasoftware.messageserver.services.handlers.MessageContainerImpl;
      import fi.logiasoftware.resourceadapters.common.AbstractProtocolHandler;
      import fi.logiasoftware.resourceadapters.common.DirectoryInfo;
      import fi.logiasoftware.resourceadapters.common.ProtocolHandlerException;
      import fi.logiasoftware.resourceadapters.generic.cci.GenericConnection;
      import fi.logiasoftware.resourceadapters.generic.cci.GenericConnectionFactory;
      import fi.logiasoftware.resourceadapters.generic.cci.GenericConnectionSpec;
      
      
      @MessageDriven(activationConfig =
      {
      @ActivationConfigProperty(propertyName="messagingType", propertyValue="javax.jms.MessageListener"),
      @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
      @ActivationConfigProperty(propertyName="Destination", propertyValue="testqueue"),
      @ActivationConfigProperty(propertyName="Transacted", propertyValue="true"),
      @ActivationConfigProperty(propertyName="resourceAdaptorName", propertyValue="sonic-jms-ra.rar")
      })
      
      public class MessageListenerBean implements MessageListener {
      
       private static final long serialVersionUID = -2963937156517739161L;
      .
      .
      .
      .
      .
      
      
      }
      
      
      


      Thanks,

      Sodo