Search code examples
glassfishjmsmessage-queuemessage-driven-bean

Problems creating JMS Queue on Glassfish


i'm get the following error when deploying my application with a JMS producer and consumer

com.sun.enterprise.connectors.ConnectorRuntimeException: JMS resource not created : QueueName

I used the annotations below:

Producer

@Resource(name = "jms/EmailNotificationQueue", mappedName = "EmailNotificationQueue")
private Destination destination;

@Resource(name = "jms/QueueConnectionFactory")
private ConnectionFactory connectionFactory;

I then create the connection and start it before sending the message

Consumer

@MessageDriven(name = "EmailNotificationBean", activationConfig = {                                           
@ActivationConfigProperty(                                  
    propertyName="destinationType",                         
    propertyValue="javax.jms.Queue"),                       
@ActivationConfigProperty(                                  
    propertyName="destinationName",                         
    propertyValue="EmailNotificationQueue"),
@ActivationConfigProperty(
    propertyName="acknowledgeMode",
    propertyValue="CLIENT_ACKNOWLEDGE")

}   
,mappedName = "EmailNotificationQueue"                                                                               
)   

Solution

  • Have you manually created the Destination?

    Log into the admin console, expand Resource, JMS Resources, then Destination Resources. You'll probably need to create a connection factory as well.