Question

I'm using JBoss Wildfly and like to Produce messages in a remote (not embedded) JMS Queue (active-mq-5.9) from a Session Bean.

My Bean:

@Stateless
@ResourceAdapter("activemq-ra.rar")
public class FinancialLoggerBean implements FinancialLoggerRemote, ManagedBean {

    private static final Logger logger = Logger.getLogger(FinancialLoggerBean.class.getName());

    @Resource(lookup = "jboss/ConnectionFactory")
    private ConnectionFactory connectionFactory;

    @Resource(lookup = "jboss/queue/financialLogQueue")
    private Destination destination;

    private Connection connection;

    @EJB
    private FinancialLoggerBeanManager ejbManager;

    ...
}

I found some examples on the web how to configure the Link between jboss and active-mq via a resource adapter. In my standalone.xml I've configured the adapter like this:

<subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">
        <resource-adapters>
            <resource-adapter>
                    <archive>
                        activemq-rar.rar
                    </archive>
                    <transaction-support>XATransaction</transaction-support>
                    <config-property name="UseInboundSession">
                        false
                    </config-property>
                    <config-property name="ServerUrl">
                        failover:(tcp://127.0.0.1:61616)
                    </config-property>
                    <connection-definitions>
                        <connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:jboss/ConnectionFactory" enabled="true" pool-name="ConnectionFactory">
                            <xa-pool>
                            <min-pool-size>10</min-pool-size>
                            <max-pool-size>100</max-pool-size>
                            <prefill>true</prefill>
                      </xa-pool>
                        </connection-definition>
                    </connection-definitions>
                    <admin-objects>
                        <admin-object class-name="org.apache.activemq.command.ActiveMQQueue" jndi-name="java:jboss/queue/financialLogQueue" use-java-context="true" pool-name="financialLogPool">
                            <config-property name="PhysicalName">
                                financialLogQueue
                            </config-property>
                        </admin-object>
                    </admin-objects>
                </resource-adapter>
        </resource-adapters>

But the Resources cannot be linked to my bean. Something seems to be missing.

JBAS014775:    New missing/unsatisfied dependencies:
  service jboss.naming.context.java.comp."financiallogger-ear-1.0-SNAPSHOT"."financiallogger-ejb-1.0-SNAPSHOT".FinancialLoggerBean.env.jboss.ConnectionFactory (missing) dependents: [service jboss.naming.context.java.comp."financiallogger-ear-1.0-SNAPSHOT"."financiallogger-ejb-1.0-SNAPSHOT".FinancialLoggerBean.env."myBeans.FinancialLoggerBean".connectionFactory] 
  service jboss.naming.context.java.comp."financiallogger-ear-1.0-SNAPSHOT"."financiallogger-ejb-1.0-SNAPSHOT".FinancialLoggerBean.env.jboss.queue.financialLogQueue (missing) dependents: [service jboss.naming.context.java.comp."financiallogger-ear-1.0-SNAPSHOT"."financiallogger-ejb-1.0-SNAPSHOT".FinancialLoggerBean.env."myBeans.FinancialLoggerBean".destination] 

Any Hints?

Thanks,

Michel

Was it helpful?

Solution

Looks like a config problem in your MQ module in your JBoss library management.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top