在 Glassfish 上创建 JMS 队列时出现问题
使用 JMS 生产者和消费者部署应用程序时出现以下错误,
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"
)
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"
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否手动创建了目标?
登录管理控制台,展开“资源”、“JMS 资源”,然后展开“目标资源”。您可能还需要创建一个连接工厂。
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.