views:

242

answers:

2

I'm attempting to use the sample broker that comes with ActiveMQ 5 with an MDB deployed on JBoss 5.1 AS.

I've deployed the activemq rar to the deploy directory. I've deployed activemq-jms-ds.xml to deploy/messaging which defines my connection factories. I have the broker running on localhost:61616 as defined in the connectionfactory config.

But when I attempt to deploy my MDB to jboss I get this error.

21:40:17,328 ERROR [JmsActivation] Unable to reconnect  org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@1332207(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@14e7167 destination=MATT.TEST destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
javax.naming.NameNotFoundException: MATT.TEST not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.util.naming.Util.lookup(Util.java:222)
at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDestination(JmsActivation.java:464)
at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:352)
at org.jboss.resource.adapter.jms.inflow.JmsActivation.handleFailure(JmsActivation.java:292)
at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:733)
at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:205)
at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:260)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

I'm really set on using the standard broker for now because I don't want to define a Client to place messages onto the queue. I prefer to use the web console that comes with the example broker. Is there something that I'm missing because I can't seem to figure out whats wrong.

Note: I've tried The ActiveMQ Jboss setup guide but I fear that it is too outdated being for ActiveMQ 4.

A: 

I found the answer buried inside this forum post.

After following the tutorial above you need to add @ResourceAdapter("your-activemq-rar-name.rar") at the top of your MDB class outside of the @MessageDriven enum right before the class definition. This tells the deployer to package the ActiveMQ resource adapter with the EJB. Note that after searching the jboss documentation for at least 3 hours before looking at the forums I didn't once see the @ResourceAdapter mentioned! I hope this saves someone alot of headaches that I had.

controlfreak123
+1  A: 

Anyone stuck on this problem might want to check this post. So, so simple. No data source files, no configured ra.xml.

Adam Schmidt
Yeah thats basically what I ended up doing! Thanks for the link though
controlfreak123