activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abdul Alhazred <thar...@tradedesksoftware.com>
Subject EJB3 MDB JBoss
Date Tue, 05 Dec 2006 22:07:01 GMT

OK, I'm totally stumped...
Is there ANY possible way to get an EJB3 MDB to deploy against activemq RA,
whatsoever? jboss.org is no help at all, as usual (great place to never get
any answer to any question, sigh...).

JBoss-4.0.4.GA
EJB3-RC9 or 8 or heaven help trying to sort out there version numbers...

I've tried activemq-ra 4.0.1, 4.0.2 and 4.1 snapshot. How hard can it really
be to implement createConnectionConsuer()? It may be 'optional', but
obviously it ain't very optional in the real world... 

package com.tradedesksoftware.ecn.masterlog;

import javax.ejb.ActivationConfigProperty;
import javax.ejb.EJB;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

import org.apache.log4j.Logger;

/**
 * @author tharter
 *
 */
@MessageDriven(activationConfig =
        {
        @ActivationConfigProperty(propertyName="destinationType",
propertyValue="javax.jms.Topic"),
        @ActivationConfigProperty(propertyName="destination",
propertyValue="topic/MasterLog")
//        @ActivationConfigProperty(propertyName="resourceAdaptorName",
propertyValue="activemq-rar-4.0.2.rar")
//        @ActivationConfigProperty(propertyName="useRAManagedTransaction",
propertyValue="true"),
        })
public class MasterLoggingMDB implements MessageListener
{
	
	@EJB
	private MasterLog masterlog;
	
	private final static Logger logger =
Logger.getLogger(MasterLoggingMDB.class.getName());
	
	public void onMessage(Message message)
	{
		try
		{
			String type = message.getStringProperty("ECNMessageType");
			logger.debug("logging message of type "+type);
			long timestamp = message.getJMSTimestamp();
			String id = message.getStringProperty("ECNMessageID");
			LogEntry entry = new LogEntry();
			entry.setId(id);
			entry.setTimestamp(timestamp);
			entry.setType(type);
			entry.setMessage(((TextMessage)message).getText());
			masterlog.addToLog(entry);
		} catch (JMSException e)
		{
			logger.error("Failed to log message to master log",e);
			throw new Error(e);
		}
	}
}

javax.jms.JMSException: Not Supported.
        at
org.apache.activemq.ra.ManagedConnectionProxy.createConnectionConsumer(ManagedConnectionProxy.java:235)
        at org.jboss.ejb3.mdb.MDB.innerCreateTopic(MDB.java:513)
        at org.jboss.ejb3.mdb.MDB.innerCreate(MDB.java:342)
        at org.jboss.ejb3.mdb.MDB.innerStart(MDB.java:225)
        at
org.jboss.ejb3.mdb.MDB$ExceptionListenerImpl.onException(MDB.java:1133)
        at org.jboss.ejb3.mdb.MDB$1.run(MDB.java:237)


jms-ds.xml

<?xml version="1.0" encoding="UTF-8"?>

<connection-factories>
 
  <!-- ====================================================================
-->
  <!-- JMS Stuff                                                           
-->
  <!-- ====================================================================
-->

  <!-- The JMS provider loader -->
  <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
	 name="activemq:service=JMSProviderLoader,name=JMSProvider">
    <attribute name="ProviderName">DefaultJMSProvider</attribute>
<!--	<attribute name="ProviderName">ActiveMQJMSProvider</attribute> -->
    <attribute name="ProviderAdapterClass">
      org.jboss.jms.jndi.JNDIProviderAdapter
    </attribute>
    <!-- The combined connection factory -->
    <attribute name="FactoryRef">ConnectionFactory</attribute>
    <!-- The queue connection factory -->
    <attribute name="QueueFactoryRef">QueueConnectionFactory</attribute>
    <!-- The topic factory -->
    <attribute name="TopicFactoryRef">TopicConnectionFactory</attribute>
    <!-- Uncomment to use HAJNDI to access JMS
    <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
       java.naming.provider.url=localhost:1100
    </attribute>
    -->
  </mbean>

  <!-- The server session pool for Message Driven Beans -->
  <mbean code="org.jboss.jms.asf.ServerSessionPoolLoader"
	 name="activemq:service=ServerSessionPoolMBean,name=StdJMSPool">
    <depends
optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
    <attribute name="PoolName">StdJMSPool</attribute>
    <attribute name="PoolFactoryClass">
      org.jboss.jms.asf.StdServerSessionPoolFactory
    </attribute>
  </mbean>
</connection-factories>

my connection factories/destinations...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE connection-factories PUBLIC "-//JBoss//DTD JBOSS JCA Config
1.5//EN" "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
<connection-factories>
   <tx-connection-factory>
      <jndi-name>ConnectionFactory</jndi-name>
      <xa-transaction>true</xa-transaction>
      <track-connection-by-tx/> <!-- Thanks to Adrian Brock for pointing
this one out! -->
<!--	  <rar-name>activemq-ra-4.0.1.rar</rar-name> -->
	  <rar-name>activemq-rar-4.1-SNAPSHOT.rar</rar-name>
     
<connection-definition>javax.jms.ConnectionFactory</connection-definition>
      <security-domain-and-application /> <!--
JmsXARealm</security-domain-and-application> -->
      <use-java-context>false</use-java-context>
   </tx-connection-factory>
   
   <tx-connection-factory>
      <jndi-name>QueueConnectionFactory</jndi-name>
	  <xa-transaction>true</xa-transaction>
      <track-connection-by-tx/> <!-- Thanks to Adrian Brock for pointing
this one out! -->
	  <!--	  <rar-name>activemq-ra-4.0.1.rar</rar-name> -->
	  <rar-name>activemq-rar-4.1-SNAPSHOT.rar</rar-name>
     
<connection-definition>javax.jms.QueueConnectionFactory</connection-definition>
      <security-domain-and-application /> <!--
JmsXARealm</security-domain-and-application> -->
      <use-java-context>false</use-java-context>
   </tx-connection-factory>
   
   <tx-connection-factory>
      <jndi-name>TopicConnectionFactory</jndi-name>
	  <xa-transaction>true</xa-transaction>
      <track-connection-by-tx/> <!-- Thanks to Adrian Brock for pointing
this one out! -->
	  <!--	  <rar-name>activemq-ra-4.0.1.rar</rar-name> -->
	  <rar-name>activemq-rar-4.1-SNAPSHOT.rar</rar-name>
     
<connection-definition>javax.jms.TopicConnectionFactory</connection-definition>
      <security-domain-and-application /> <!--
JmsXARealm</security-domain-and-application> -->
      <use-java-context>false</use-java-context>
   </tx-connection-factory>

   <mbean code="org.jboss.resource.deployment.AdminObject"
name="activemq.topic:name=MasterLog">
	   <attribute name="JNDIName">topic/MasterLog</attribute>
	   <!--	  <depends
optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra-4.0.1.rar'</depends>
-->
	   <depends
optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-rar-4.1-SNAPSHOT.rar'</depends>
	   <attribute name="Type">javax.jms.Topic</attribute>
	   <attribute name="Properties">
		   PhysicalName=topic.masterlog
	   </attribute>
   </mbean>

   <mbean code="org.jboss.resource.deployment.AdminObject"
name="activemq.queue:name=DLQ">
	   <attribute name="JNDIName">queue/DLQ</attribute>
	   <!--	  <depends
optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra-4.0.1.rar'</depends>
-->
	   <depends
optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-rar-4.1-SNAPSHOT.rar'</depends>
	   <attribute name="Type">javax.jms.Queue</attribute>
	   <attribute name="Properties">
		   PhysicalName=queue.DLQ
	   </attribute>
   </mbean>
</connection-factories>
-- 
View this message in context: http://www.nabble.com/EJB3-MDB-JBoss-tf2764727.html#a7709215
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message