[MQ-263] JMS destination definition in annotation should be enough, no need to define in web.xml Created: 22/Dec/12  Updated: 02/Jan/13  Resolved: 02/Jan/13

Status: Resolved
Project: mq
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: arungupta Assignee: Ed Bratt
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: jms-2-implementation


With GlassFish build 68, seems like a JMS destination needs to be defined using annotation and web.xml as:



@JMSDestinationDefinition(name = "java:global/jms/myQueue",
        resourceAdapterName = "jmsra",
        className = "javax.jms.Queue",
        description="My Queue")
@WebServlet(name = "TestServlet", urlPatterns = {"/TestServlet"})
public class TestServlet extends HttpServlet {

If only the annotation is used then the following exception is thrown:

Caused by: java.lang.IllegalArgumentException: MQJMSRA_AS4001: setDestination:Invalid destination name=java:global/jms/myQueue
	at com.sun.messaging.jms.ra.ActivationSpec.setDestination(ActivationSpec.java:406)
	... 49 more

Only the annotation should be sufficient.

Comment by arungupta [ 26/Dec/12 ]

The correct annotation is:

@JMSDestinationDefinition(name = "java:global/jms/myQueue",
resourceAdapterName = "jmsra",
className = "javax.jms.Queue",
description="My Queue")
@WebServlet(name = "TestServlet", urlPatterns =



The destinationName attribute is the logical name, not the JNDI name. Will close the bug.

Comment by arungupta [ 26/Dec/12 ]

I'm not authorized to assign this bug to myself. Please close the bug.

Comment by Nigel Deakin [ 02/Jan/13 ]

Closing this issue as requested.

To clarify, the destinationName attribute is the same name as you would pass into the createQueue and createTopic methods on Session or JMSContext. This is referred to as the "provider-specific queue name" to distinguish it from the JNDI name.

Generated at Fri Sep 04 12:07:33 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.