2013-04-07 60 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> 

但不知道爲什麼玻璃魚需要這個。