ActiveMQ with JBoss 7.1
johnbesel Sep 6, 2013 5:22 AMHello together,
I have a problem with activemMQ implementation on JBOSS 7. We are on he way to migrate our app from JBoss 6 to JBoss 7.
I read this instruction: Integration of JBoss AS 7 with ActiveMQ
but it doesnt work for me.
I downloaded and put activemq-ra.rar into standalone/deployments/
I updated ra.xml for "ActiveMQ as an internal messaging broker"
I have following in standalone-full.xml
<resource-adapters>
<resource-adapter>
<archive>
activemq-ra.rar
</archive>
<transaction-support>XATransaction</transaction-support>
<config-property name="ServerUrl">
vm://localhost
</config-property>
<connection-definitions>
<connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:/activemq/ConnectionFactory" enabled="true" use-java-context="true" pool-name="ActiveMQConnectionFactoryPool" use-ccm="true">
<xa-pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>20</max-pool-size>
</xa-pool>
</connection-definition>
</connection-definitions>
<admin-objects>
<admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:/activemq/queue_out" enabled="true" use-java-context="true" pool-name="ActiveMQQueue.queue_out">
<config-property name="PhysicalName">
queue.queue_out
</config-property>
</admin-object>
<admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:/activemq/queue_in" enabled="true" use-java-context="true" pool-name="ActiveMQQueue.queue_in">
<config-property name="PhysicalName">
queue.queue_in
</config-property>
</admin-object>
</admin-objects>
</resource-adapter>
</resource-adapters>
in my class I try to get a connectionFactory with
Context ctx = new initialContext();
ctx.lookup("java:/activemq/ConnectionFactory");
I start my jboss like this: standalone.bat -c standalone-full.xml
during deploy process I get following exception:
An exception was thrown while retrieving the connection factory fron the jndi context under JNDI 'java:/activemq/ConnectionFactory'
Caused by: javax.naming.NameNotFoundException: activemq/ConnectionFactory -- service jboss.naming.context.java.activemq.ConnectionFactory
in the example the access to the ConnectionFactory is implemented with @Ressource(mappedName="java:/activemq/ConnectionFactory")
is it the possible to use the initialContext for this purpose???
how can I do it??
thank you for your answer.