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