简体   繁体   中英

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,

Here my code and configuration :

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

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

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

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

It results into the following Exception :

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. The target EJB for the ejb-ref could not be found. 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.

Many thanks in advance.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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