EJB JMS javax.naming.NameNotFoundException: XXX not bound

练习EJB MessageDrivenBean时部署不成功,一直报错

09:57:29,017 WARN  [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@86de21(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@199f23c destination=queue/jms destinationType=javax.jms.Queue tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
javax.naming.NameNotFoundException: jms not bound


错误原因:Jboss无法自动创建Queue对象


解决办法:

在项目部署位置

添加一个XXX-service.xml文件,内容如下

<?xml version="1.0" encoding="UTF-8"?>
<server>
     <mbean code="org.jboss.jms.server.destination.QueueService"  
          name="jboss.messaging.destination:service=Queue,name=XXX"<!--这个地方的name是你自己定义的queue/XXX-->  
          xmbean-dd="xmdesc/Queue-xmbean.xml">  
          <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>  
          <depends>jboss.messaging:service=PostOffice</depends>  
     </mbean>  

</server> 


posted @ 2014-05-07 10:04  汤姆的猫  阅读(601)  评论(0编辑  收藏  举报