简体   繁体   English

EJB 3.0 - Context.Lookup加载适当的EJB Bean失败

[英]EJB 3.0 - Context.Lookup Failed loading apropriate EJB Beans

I'm working on EJB application, and i'm trying to use lookup approach but it fails at Runtime moment, 我正在研究EJB应用程序,我正在尝试使用查找方法,但它在运行时失败,

Here my code and configuration : 这是我的代码和配置:

weblogic.xml weblogic.xml中

                    <ejb-reference-description>
                            <ejb-ref-name>
                                 RechercheClientSMBean
                            </ejb-ref-name>
                            <jndi-name>
                                *****-ejb/RechercheClientSMBean/local
                            </jndi-name>
                    </ejb-reference-description>

Local Interface 本地接口

        @Local
        public interface IRechercheClientFacade extends Facade {}

Bean Implementation Bean实现

                    @Stateless(name="RechercheClientSMBean", mappedName="RechercheClientSMBean")
                    public class RechercheClientSMBean extends AbstractBean implements IRechercheClientFacade { }

web.xml web.xml中

                    <ejb-ref>
                        <ejb-ref-name>RechercheClientSMBean</ejb-ref-name>  
                        <ejb-ref-type>Session</ejb-ref-type>  
                        <home>com.*****.***.app.service.common.client.RechercheClientSMBean</home>  
                    </ejb-ref>

Bean Lookup Code Bean查找代码

                        InitialContext ctx = new InitialContext();
                    iRechercheClientFacade= (IRechercheClientFacade)ctx.lookup("java:comp/env/RechercheClientSMBean");

It results into the following Exception : 它导致以下异常:

weblogic.deployment.EnvironmentException: weblogic.deployment.EnvironmentException:
The ejb-link 'RechercheClientSMBean' declared in the ejb-ref or ejb-local-ref 'RechercheClientSMBean' in the application module 'pfi.war' could not be resolved. 在应用程序模块“pfi.war”中的ejb-ref或ejb-local-ref“RechercheClientSMBean”中声明的ejb-link“RechercheClientSMBean”无法解析。 The target EJB for the ejb-ref could not be found. 无法找到ejb-ref的目标EJB。 Please ensure the link is correct. 请确保链接正确。

I checked every possible configuration, every naming possibility but i keep getting this same problem. 我检查了每个可能的配置,每个命名的可能性,但我不断得到同样的问题。

PS : the project is divided into multiple modules, the lookup method is made from web container. PS :项目分为多个模块,查找方法是从web容器中完成的。

Many thanks in advance. 提前谢谢了。

您是否尝试过以下操作:ctx.lookup(“java:comp / env / ejb / RechercheClientSMBean”);

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

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