资源自动链接到TomEE EJB Bean

时间:2019-03-08 21:10:02

标签: tomee message-driven-bean openejb tomee-8

我正在开发基于JMS的模块,该模块使用来自IBM MQ的消息并保留数据。我的应用程序在TomEE 8.0.0-M2中运行。启动我的应用程序时,我注意到对我所有的EJB bean都进行了自动链接resource-ref'openejb / Resource 。我已经在resources.xml中配置了与IBM MQ相关的工厂和队列以及Topic。 所有与IBM MQ相关的资源都在尝试自动与我的所有EJB bean进行链接,这会花费更多的启动时间

我的EJB都没有@Resource配置。 我有带有 @MessageDriven 批注的MDB bean。

为什么TomEE试图自动链接到所有EJB bean?

如何解决这种自动喜欢的问题?

我准备在web.xml或resources.xml中进行任何一次配置

针对一个EJB Bean(SimpleService)的示例日志

08-Mar-2019 13:33:07.558 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.processResourceRef Auto-linking resource-ref 'openejb/Resource/ROOT/imq_ra' in bean SimpleService to Resource(id=imq_ra)
08-Mar-2019 13:33:07.559 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.processResourceRef Auto-linking resource-ref 'openejb/Resource/imq_ra' in bean SimpleService to Resource(id=imq_ra)
08-Mar-2019 13:33:07.559 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.processResourceRef Auto-linking resource-ref 'openejb/Resource/ROOT/ibm.mq.connfactory' in bean SimpleService to Resource(id=ibm.mq.connfactory)
08-Mar-2019 13:33:07.559 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.processResourceRef Auto-linking resource-ref 'openejb/Resource/ibm.mq.connfactory' in bean SimpleService to Resource(id=ibm.mq.connfactory)
08-Mar-2019 13:33:07.561 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.processResourceRef Auto-linking resource-ref 'openejb/Resource/ROOT/imq_container-javax.jms.QueueConnectionFactory' in bean SimpleService to Resource(id=imq_container-javax.jms.QueueConnectionFactory)
08-Mar-2019 13:33:07.562 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.processResourceRef Auto-linking resource-ref 'openejb/Resource/imq_container-javax.jms.QueueConnectionFactory' in bean SimpleService to Resource(id=imq_container-javax.jms.QueueConnectionFactory)
08-Mar-2019 13:33:07.562 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.processResourceRef Auto-linking resource-ref 'openejb/Resource/ROOT/imq_container-javax.jms.TopicConnectionFactory' in bean SimpleService to Resource(id=imq_container-javax.jms.TopicConnectionFactory)
08-Mar-2019 13:33:07.563 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.processResourceRef Auto-linking resource-ref 'openejb/Resource/imq_container-javax.jms.TopicConnectionFactory' in bean SimpleService to Resource(id=imq_container-javax.jms.TopicConnectionFactory)
08-Mar-2019 13:33:07.566 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.processResourceRef Auto-linking resource-ref 'openejb/Resource/ROOT/download.topic' in bean SimpleService to Resource(id=download.topic)
08-Mar-2019 13:33:07.571 INFO [localhost-startStop-1] org.apache.openejb.config.AutoConfig.processResourceRef Auto-linking resource-ref 'openejb/Resource/download.topic' in bean SimpleService to Resource(id=download.topic)

0 个答案:

没有答案