geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fredrik Jonson <>
Subject How do I declare and inject a jms resource in a connector component?
Date Wed, 21 Jan 2009 15:44:54 GMT

I have a ear that contains a rar with a ResourceAdapter. In my
resource adapter I need to use the jms resources that I've declared
in geronimo-application.xml - a activemq connection factory and
a queue. 

I've tried to inject with annotations:

 public class FooAdapter implements ResourceAdapter
    @Resource(name = "ConnectionFactory")
    private javax.jms.ConnectionFactory connectionFactory;
    @Resource(name = "foo.gateway")
    private Queue gatewayQueue;


But when I do that my adapter just hangs on the call to:

    Connection c = connectionFactory.createConnection();

I also tried jndi lookup, and it fails too, so I suspect that I need
to declare that the rar component has a dependency on the jms-resources
that I have declared in geronimo-application.xml?

The thing is, I do not see any exceptions when I deploy the jca component,
and geronimo seems to inject something. Otherwise I'd expect a nullpointer
exception on deployment.

Anyway, I'd be greatful for any help here.

Below is my geronimo-ra.xml (the ra.xml is as minimal):

<?xml version="1.0" encoding="UTF-8"?>
<connector xmlns="">
  <dep:environment xmlns:dep="">

Fredrik Jonson

View raw message