Can't deploy MDB on JBoss AS 7.1 to consume from standalone HornetQ
pmerson Aug 28, 2012 2:39 PMI (too) am having trouble deploying an MDB on JBoss AS 7.1 that will consume from a queue in a remote standalone HornetQ.
My test scenario (using only my Windows 7 desktop for now):
1) Open a command prompt and launch standalone HornetQ 2.2.14.final with QueueX configured.
2) A Java main client sends messages to QueueX.
3) On a separate command prompt, launch JBoss AS 7.1.0.final using standalone.xml. HornetQ is *not* integrated in this JBoss instance.
4) Deploy hornetq-ra.rar on jboss-as-7.1.0.Final\standalone\deployments. File ra.xml inside hornetq-ra.rar is configured to connect to HornetQ on localhost:
{code:xml}
<config-property>
<description>
The transport type. Multiple connectors can be configured by using a comma separated list,
i.e. org.hornetq.core.remoting.impl.invm.InVMConnectorFactory,org.hornetq.core.remoting.impl.invm.InVMConnectorFactory.
</description>
<config-property-name>ConnectorClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property-value>
</config-property>
<config-property>
<description>The transport configuration. These values must be in the form of key=val;key=val;,
if multiple connectors are used then each set must be separated by a comma i.e. host=host1;port=5445,host=host2;port=5446.
Each set of params maps to the connector classname specified.
</description>
<config-property-name>ConnectionParameters</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>host=127.0.0.1;port=5445</config-property-value>
</config-property>
{code}
5) Deploy a single MDB that consumes messages from QueueX. Activation properties:
{code}
@MessageDriven(
activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "/queue/QueueX),
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
@ActivationConfigProperty(propertyName = "connectorClassName", propertyValue = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"),
@ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=localhost;port=5445")
})
@ResourceAdapter("/hornetq-ra.rar")
{code}
All the steps up to #5 work fine. The resource adapter is deployed successfully:
14:20:19,247 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "hornetq-ra.rar"
But the deployment of my EAR containing a single MDB fails with this cryptic error message:
JBAS014775: New missing/unsatisfied dependencies:
service jboss.ra.hornetq-ra (missing) dependents: [service jboss.deployment.subunit."monitoramentoEar.ear"."monitoramentoEjb.jar".component.MdbLoggerBD.CREATE]
17:01:14,875 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.subunit.\"monitoramentoEar.ear\".\"monitoramentoEjb.jar\
".component.MdbLoggerBD.CREATEjboss.ra.hornetq-raMissing[jboss.deployment.subunit.\"monitoramentoEar.ear\".\"monitoramentoEjb.jar\".component.MdbLoggerBD.CREATEjboss.ra.hornetq-ra]"]}}}
Following the MDB deployment failure, if I stop the JBoss server, an intriguing message appears on the console:
JBAS014776: Newly corrected services:
service jboss.ra.hornetq-ra (new available)
Any help to solve this problem is greatly appreciated.
Things I tried and didn’t solve the problem:
1) Using standalone-full on JBoss.
2) Removing the @ResourceAdapter("/hornetq-ra.rar") annotation from the MDB.
3) Copying file jms-remote-ds.xml to the deployments directory. (Deployment failed with a parse error message. A forum search showed me this file is not valid in AS 7.)
Things I didn’t try yet:
1) Deploying hornetq-ra.rar inside the ear. No documentation indicates this is the solution, and it poses a connector configuration challenge when I have multiple ear files.
2) Define a JMS connection factory or pooled connection factory in my JBoss configuration. Didn’t see clear instructions pointing in that direction for my scenario (no HornetQ integrated to JBoss).
3) Debugging AS 7 deployer code.
4) Cursing at the screen (female coworkers nearby).
5) Lighting a candle (smoke detector right above).
Links I studied, helped me move forward, but didn’t present a working solution for my scenario:
- MDB connecting to remote HornetQ:
- Configuring the JCA adapter:
- HornetQ example that might help:
- file:///D:/desv/hornetq-2.2.14.Final/examples/javaee/jca-config/readme.html
- Configuring the Transport in HornetQ:
- Configuring the MDB code:
- About HornetQ on JBoss 7:
- Example of MDB in the JBoss documentation: