在ejb-jar中配置
     <message-driven>
<description>xxxx</description>
<ejb-name>xxxx</ejb-name>
<ejb-class>xxxxx</ejb-class>
<transaction-type>Container</transaction-type>
<acknowledge-mode>Auto-acknowledge</acknowledge-mode>
    <message-selector></message-selector>
<message-driven-destination>
<destination-type>javax.jms.Topic</destination-type>
</message-driven-destination>
       </message-driven>

解决方案 »

  1.   

    只在ejb-jar.xml中设置吗?不需要在JBoss里做什么?
      

  2.   

    jms和message driven bean是两回事
    部署是通过xml配置文件完成的,可以看jboss里面的例子,如:<mbean code="org.jboss.mq.server.jmx.Topic"
     name="jboss.mq.destination:service=Topic,name=testTopic">
        <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
        <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
        <attribute name="SecurityConf">
          <security>
            <role name="guest" read="true" write="true"/>
            <role name="publisher" read="true" write="true" create="false"/>
            <role name="durpublisher" read="true" write="true" create="true"/>
          </security>
        </attribute>
      </mbean>