Search code examples
javaexceptionjarejbweblogic

javax.naming.NameNotFoundException:while trying to lookup


I have a problem that I get the following error. Project has jar about this services and my web.xml following

Please help me.

<ejb-local-ref>
    <ejb-ref-name>ejb/KpsSessionFacade</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>tr.com.meop.db.session.KpsSessionFacadeLocal</local>
    <ejb-link>KpsSessionFacade</ejb-link>
</ejb-local-ref>

Log:

javax.naming.NameNotFoundException: While trying to look up comp/env/ejb/KpsSessionFacade in /app/ejb/meop-service-1.jar#KisiManagerService.; remaining name 'comp/env/ejb/KpsSessionFacade'

at javax.naming.InitialContext.lookup(InitialContext.java:411) at tr.com.meop.scheduler.client.MernisWsFactory.log(MernisWsFactory.java:686) at tr.com.meop.scheduler.client.MernisWsFactory.tcKimliktenAdresSorgula(MernisWsFactory.java:300) at tr.com.meop.business.kisi.service.KisiManagerServiceImpl.findKisiBilgisiByTckn(KisiManagerServiceImpl.java:344) . . .

at tr.com.meop.app.kisi.action.KisiAction.bulKisiBilgilerByTcknProcess(KisiAction.java:684) at tr.com.meop.app.kisi.action.KisiAction.bulKisiBilgilerByTckn(KisiAction.java:672) . .


Solution

  • Add a prefix java in your lookup code. It will be like below:

    "java:comp/env/ejb/KpsSessionFacade"
    

    A full example is given in this link: javax.naming.NameNotFoundException: jdbc not bound

    Some steps are used for checking, is given here: javax.naming.NameNotFoundException: Unable to resolve 'MyDB'. Resolved '' Weblogic 12.1.3. c