简体   繁体   English

无法注入jboss 7中applicationcontext.xml中指定的EJB

[英]Cannot inject EJB specified in applicationcontext.xml in jboss 7

I'm trying to migrate my Java EE application from jboss 5.1 to jboss 7.1 and getting a deployment error. 我正在尝试将Java EE应用程序从jboss 5.1迁移到jboss 7.1,并遇到部署错误。

My EAR has 2 EJB modules and 1 WAR module. 我的EAR有2个EJB模块和1个WAR模块。 both EJB modules gets deployed without any issue. 部署两个EJB模块都没有任何问题。 but when i'm trying to deploy with the WAR module it says 但是当我尝试使用WAR模块进行部署时,它说

Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name "className" Injection of resource fields failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'java:global/ear/ejb/FacadeBean!com.ejb.business.SearchFacade' is defined: not found in JNDI environment

because of copyright issues i'm unable to disclose the full class names. 由于版权问题,我无法透露完整的班级名称。 but "classname" is defined as a bean in my spring application context file and it has a dependency injection of SearchFacade which again has some dependencies. 但“类名”在我的Spring应用程序上下文文件中定义为Bean,并且它具有SearchFacade依赖项注入,该依赖项又具有一些依赖项。

whats confusing is that in the jboss log it shows that SearchFacade is deployed without any issues. 令人困惑的是,它在jboss日志中显示SearchFacade的部署没有任何问题。

i'm finding so hard to find a solution for this issue. 我很难找到解决这个问题的方法。 any help will be greatly appreciated. 任何帮助将不胜感激。

thanks in advance. 提前致谢。

Looks like spring is not able to determine that the EJB component is in that EJB Jar and you need to enforce that the components in that EJB jar are initialized and started before the components in you WAR. 看起来spring不能确定EJB组件是否在该EJB Jar中,因此您需要强制在WAR中的组件之前初始化并启动该EJB jar中的组件。

Did you tried to set element into your application*xml and see if that helped? 您是否尝试将元素设置到应用程序* xml中,看看是否有帮助?

Something like this in your application.xml 您的application.xml中类似这样的内容

<application-name>EAR</application-name>
<initialize-in-order>true</initialize-in-order>
<module><ejb>EJB.jar</ejb></module>
<module><web><web-uri>WAR.war</web-uri><context-root>....

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM