I'd like to do some experiments with JMS on jBoss WildFly 8.2.
The default WildFly standalone-full.xml
configuration file has the following fragments:
<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>
I am trying to inject this connection factory and this topic into an EJB in the following way:
@Stateless
public class JmsPublisher {
@Resource(mappedName = "java:/ConnectionFactory")
ConnectionFactory jmsConnectionFactory;
@Resource(mappedName = "java:/jms/topic/MyTestTopic")
Topic topic;
But I get the following error message at deployment:
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]"
What am I doing wrong?