2
创建JMS队列
我与JMS生产者和消费者部署我的应用程序时问题Glassfish上
com.sun.enterprise.connectors.ConnectorRuntimeException: JMS resource not created : QueueName
我用下面的注解是出现以下错误:
Producer
@Resource(name = "jms/EmailNotificationQueue", mappedName = "EmailNotificationQueue")
private Destination destination;
@Resource(name = "jms/QueueConnectionFactory")
private ConnectionFactory connectionFactory;
然后创建连接并在发送消息前启动它
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"
)
你的classpath中有glassfish-resources.xml文件吗?当我在Netbeans中创建JMS时,它会自动添加这些包含jms配置的文件。它位于'其他来源/设置'。我不必手动创建Queue和QueueConnectionFactory – Damian 2013-07-17 13:22:26