2013-04-07 108 views
0

我尝试在“行动EJB3”的例子在GlassFish应用服务器(第2章的例子),它有一个MDB从而未能与JMS资源不创建

JMS resource not created : OrderBillingQueue 

我已经创建的连接错误部署资源和目的地资源在其他职位的建议,但错误依然存在。请帮我解决这个问题。

这里是在GlassFish中创建的JMS资源的快照 enter image description here


enter image description here

的源代码的相关部分:MDB

@MessageDriven(activationConfig = { 
     @ActivationConfigProperty(propertyName="destinationName", propertyValue="OrderBillingQueue"), 
     @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue") 
     },mappedName = "OrderBillingQueue" 
) 
public class OrderBillingMDB implements MessageListener { 

源的相关部分代码:资源注入部分

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

@Resource(name = "jms/OrderBillingQueue", mappedName="OrderBillingQueue") 
private Destination billingQueue; 

回答

0

将下列内容添加到glassfish-ejb-jar.xml文件似乎可以解决问题。

<glassfish-ejb-jar> 
    <enterprise-beans> 
     <ejb> 
      <ejb-name>OrderBillingMDB</ejb-name> 
      <jndi-name>jms/OrderBillingQueue</jndi-name> 
     </ejb></enterprise-beans> 
</glassfish-ejb-jar> 

但不知道为什么玻璃鱼需要这个。