This may be a better question asked on the JBoss dev lists. From the
stack trace it seems like the JBossMQ connection is being used of some
reason with the ActiveMQ destinations. Weird.
On 6/4/06, Martin <[EMAIL PROTECTED]> wrote:
Hi,
Has anyone tried to use EJB3 style MDB with AtiveMQ deployed in JBoss 4 ?
I keep trying but JBoss gives me java.lang.ClassCastException during MDB
deployment. I tried ActiveMQ 3.2.2 and 4 with the same result.
Here is my test MDB and the stack trace form JBoss 4.0.4 GA:
--------------
package test.mdb;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
@MessageDriven( activationConfig =
{
@ActivationConfigProperty(propertyName="destinationType",
propertyValue="javax.jms.Queue"),
@ActivationConfigProperty(propertyName="destination",
propertyValue="queue/mdbTestQueue"),
@ActivationConfigProperty(propertyName="resourceAdaptorName",
propertyValue="activemq-ra-3.2.2.rar"),
@ActivationConfigProperty(propertyName="connectionFactoryName",
propertyValue="java:/AMQQueueConnectionFactory"),
})
public class PostSenderBean implements MessageListener {
public void onMessage(Message message) {
System.out.println("PostSenderBean.onMessage()");
}
}
and the JBoss Error:
16:15:47,867 WARN [ServiceController] Problem starting service jboss.j2ee:jar=h
pejb.jar,name=PostSenderBean,service=EJB3
java.lang.ClassCastException: org.activemq.message.ActiveMQQueue
at org.jboss.mq.SpyConnectionConsumer.<init>(SpyConnectionConsumer.java:
107)
at org.jboss.mq.SpyConnection.createConnectionConsumer(SpyConnection.jav
a:209)
at org.jboss.ejb3.mdb.MDB.innerCreateQueue(MDB.java:424)
at org.jboss.ejb3.mdb.MDB.innerCreate(MDB.java:347)
at org.jboss.ejb3.mdb.MDB.innerStart(MDB.java:225)
at org.jboss.ejb3.mdb.MDB.start(MDB.java:214)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
<rest of the StackTrace>
16:15:47,877 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
--- MBeans waiting for other MBeans ---
ObjectName: jboss.j2ee:jar=hpejb.jar,name=PostSenderBean,service=EJB3
State: FAILED
Reason: java.lang.ClassCastException: org.activemq.message.ActiveMQQueue
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.j2ee:jar=hpejb.jar,name=PostSenderBean,service=EJB3
State: FAILED
Reason: java.lang.ClassCastException: org.activemq.message.ActiveMQQueue
-----------------------
The same bean works great with JBossMQ! Any help will be greatly appreciated.
best regards
Martin
--
Regards,
Hiram