Java Wildfly 9 JMS注入未发生

Java Wildfly 9 JMS注入未发生,java,jboss,jms,cdi,wildfly,Java,Jboss,Jms,Cdi,Wildfly,JBoss 9.02-final中部署了以下类,但注入的字段为空: @ApplicationScoped public class JMSEventPublisher implements IEventPublisherClient { @Inject private JMSContext context; @Resource (mappedName = "java:/jms/queue/Events") private Queue syncQueue; 我

JBoss 9.02-final中部署了以下类,但注入的字段为空:

@ApplicationScoped
public class JMSEventPublisher implements IEventPublisherClient {

    @Inject
    private JMSContext context;

    @Resource (mappedName = "java:/jms/queue/Events")
    private Queue syncQueue;
我尝试过使用
@Stateless
而不是
@ApplicationScoped
,我尝试过使用
lookup
而不是
mappedName
,但是上下文和syncQueue字段从未被注入(因此,当我尝试发送JMS消息时,会出现空指针异常)

战争启动时,JBoss日志中没有错误消息。在JBoss启动时,这里是与JMS相关的输出,我们可以看到命名队列似乎在启动时没有任何错误消息:

10:41:59,972 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 64) HQ221001: HornetQ Server version 2.4.7.Final (2.4.7.Final, 12
4) [34da3fdf-8dba-11e5-9213-51bb5b0e6fe5] 
10:42:00,399 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 64) WFLYMSG0002: Bound messaging object to jndi name java:jboss/ex
ported/jms/RemoteConnectionFactory
10:42:00,459 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 68) HQ221003: trying to deploy queue jms.queue.DLQ
10:42:00,471 INFO  [org.jboss.as.messaging] (ServerService Thread Pool -- 69) WFLYMSG0002: Bound messaging object to jndi name java:/Connect
ionFactory
10:42:00,472 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 67) HQ221003: trying to deploy queue jms.queue.Events
10:42:00,476 INFO  [org.hornetq.core.server] (ServerService Thread Pool -- 66) HQ221003: trying to deploy queue jms.queue.ExpiryQueue
10:42:00,550 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-3) WFLYJCA0007: Registered connection factory java:/JmsXA
10:42:00,633 INFO  [org.hornetq.ra] (MSC service thread 1-3) HornetQ resource adaptor started
10:42:00,642 INFO  [org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service 
thread 1-3) IJ020002: Deployed: file://RaActivatorhornetq-ra
10:42:00,647 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-3) WFLYJCA0002: Bound JCA ConnectionFactory [java:/JmsXA]
10:42:00,648 INFO  [org.jboss.as.messaging] (MSC service thread 1-3) WFLYMSG0002: Bound messaging object to jndi name java:jboss/DefaultJMSC
onnectionFactory

知道为什么没有注射吗?

感谢@John Ament,他提出了正确的问题。我发现在my factory类中,引用是由一个
new
创建的,因此WELD没有进行注入。问题解决了


我删除了
新的JMSEventPublisher()
,而是在factory类的字段中添加了
@Inject
(顺便说一句,我的
JMSEventPublisher
工作版本使用
lookup
而不是
mappedName
来查找
同步队列的资源)

感谢@John Ament,他提出了正确的问题。我发现在my factory类中,引用是由一个
new
创建的,因此WELD没有进行注入。问题解决了


我删除了
新的JMSEventPublisher()
,而是在factory类的字段中添加了
@Inject
(顺便说一句,我的
JMSEventPublisher
工作版本使用
lookup
而不是
mappedName
来查找
同步队列的资源)

如何检索对此类的引用?部署的lib文件夹是什么样子的?如何检索对此类的引用?部署的lib文件夹是什么样子的?