Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Piet Souris

Lookup EJB3 from web app in weblogic

Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am trying to lookup a stateless session bean from my web application. My web application and jar containing EJB are packaged in same ear file. I am using EJB3 and Weblogic 10.3
I have specified local-jndi-name of my EJB in weblogic-ejb-jar.xml packaged with my EJB jar.

But I am unable to lookup this EJB from my web app using JNDI name "Repository/local" .
I then included an ejb-local-ref to this EJB in web.xml of my web app like this

Then I was able to lookup this EJB in my web app using JNDI name "java:comp/env/ejb/Repository".

Now my question is, if I have specified local JNDI name in weblogic-ejb-jar.xml, do I still have to include an ejb-ref in my web.xml to lookup that EJB? Is there some other way using which I can lookup EJB using JNDI name I specify in weblogic-ejb-jar.xml, without modifying my web.xml?

She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic