【发布时间】:2015-05-02 01:13:45
【问题描述】:
我想在 jBoss WildFly 8.2 上使用 JMS 做一些实验。
默认的 WildFly standalone-full.xml 配置文件有以下片段:
<hornetq-server>
<connectors>
...
<in-vm-connector name="in-vm" server-id="0"/>
</connectors>
...
<jms-connection-factories>
<connection-factory name="InVmConnectionFactory">
<connectors>
<connector-ref connector-name="in-vm"/>
</connectors>
<entries>
<entry name="java:/ConnectionFactory"/>
</entries>
</connection-factory>
...
</jms-connection-factories>
<jms-destinations>
<!-- this destination I have added myself as I need a "topic", but
the default configuration has only two preconfigured "queues". -->
<jms-topic name="MyTestTopic">
<entry name="java:/jms/topic/MyTestTopic"/>
</jms-topic>
</jms-destinations>
</hornetq-server>
我正在尝试通过以下方式将此连接工厂和此主题注入 EJB:
@Stateless
public class JmsPublisher {
@Resource(mappedName = "java:/ConnectionFactory")
ConnectionFactory jmsConnectionFactory;
@Resource(mappedName = "java:/jms/topic/MyTestTopic")
Topic topic;
但我在部署时收到以下错误消息:
Operation ("deploy") failed ... Services with missing/unavailable dependencies" => ...
...JmsPublisher\".jmsConnectionFactory is missing [jboss.naming.context.java.ConnectionFactory]"
...JmsPublisher\".topic is missing [jboss.naming.context.java.jms.topic.MyTestTopic]"
我做错了什么?
【问题讨论】:
标签: jakarta-ee jboss jms jndi wildfly