Nigel, thanks for the clue. Once I got things working I was in a position to back-track to figure a few things out. I'd like to summarize my findings for other entrants into the NetBeans / Glassfish / JMS / MDB / Connection Factory / AddressList maze (yea, I put that list in for the search engines... :-); other App Servers provide different settings.
1. There are two key elements in getting the local MDB to receive from a remote Queue:
a) A local <JMS Connection Factory> that references the remote host via a valid AddressList, and
b) A local <JMS Destination Resource> that provides the 'physical destination name' of the Q on the remote host (seen as the 'name' property on an existing resource). Repeat: Local JNDI resource. Remote 'physical destination name'. The 'physical destination name's MUST match on both the local and remote system.
2. [WARNING - hidden behavior to the uninitiated] When NetBeans creates an MDB, it also creates a 'sun-resources.xml' file (in the setup subfolder). The wizard populates this file with three resources:
a) a <Admin Object Resource> naming the Destination Resource's JNDI name
b) a <Connector Resource> naming the ConnectionFactory's JNDI name, and
c) a <Connector Connection Pool> resource.
From these, by some behind the scenes mapping, the <JMS Destination Resource> and <JMS ConnectionFactory> are established. Everytime the bean is deployed, these resources were (re)created in App Server. Specifically, any changes/properties to these 3 (5) resources through the Admin Console are lost. Therefore, either set the properties in this file or (create and) set the properties via the Admin Console & delete this file.
2. For an MDB there is not a default connection factory visible in the JNDI name space. In fact, the <JMS Connection Factory> defined (above) in the sun-resources.xml file is NOT used by the MDB (didn't work for me anyway). So, to specify the AddressList there are two options:
Option 1: Set the AddressList property via annotation on the MDB:
@MessageDriven(mappedName = "jms/myQ",
activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "addressList", propertyValue = "mq://my.remote.host:7676,")
})
Option 2: Specify a <JMS Connection Factory>. This can be specified to Glassfish by only one means (today) for the native jmsra (JMS resource adapter) [not true for the generic adapter.. another topic]. In sun-ejb-jar.xml, for the specific MDB:
<...standard stuff...>
<sun-ejb-jar>
<enterprise-beans>
<ejb>
<ejb-name>myMDB</ejb-name>
<mdb-connection-factory>
<jndi-name>jms/myMDBSpecialQFactory</jndi-name>
</mdb-connection-factory>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
Note that I find no way to specify this using the fancier deployment editor, I had to edit the XML directly.
You may then use either the sun-resources.xml file to define (and (re)create) your resources, or (having deleted sun-resources.xml) use the Glassfish Admin Console to create the <JMS Connection Factory>, and set the property named "AddressList" with value ("mq://my.remote.host:7676/").
If you use sun-resources.xml, then set the property definition in the 'connector-connection-pool' (it won't be seen if set on the <Connector Resource>):
<connector-connection-pool ...attributes...>
<property name="AddressList" value="mq://my.remote.host:7676/"/>
</connector-connection-pool>
<ras>
[Message sent by forum member 'rsitze' (rsitze)]
http://forums.java.net/jive/thread.jspa?messageID=359982