• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Junilu Lacar
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst
  • Peter Rooke
  • Mikalai Zaikin
  • Himai Minh

i am trying to get this jndi lookup right. Need you hint.

Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all
I am trying to lookup the customer entity bean from the jsp page.
In jsp I write this statement.
jndiContext = EJBHelper.getInitialContext();
Object ref = jndiContext.lookup("java:comp/env/ejb/customer");
and I have defined my getInitialContext function like this:
public static Context getInitialContext() throws NamingException {
// String url = "t3://DEFAULT-E38STB3:7001";
String url = "t3://";
String user = null;
String password = null;
Properties properties = null;
try {
properties = new Properties();
properties.put(Context.PROVIDER_URL, url);
if (user != null) {
properties.put(Context.SECURITY_PRINCIPAL, user);
password == null ? "" : password);
return new InitialContext(properties);
catch (NamingException e) {
System.out.println("Unable to connect to WebLogic server at " + url);
System.out.println("Please make sure that the server is running.");
throw e;
and I have setup the web.xml like this:
<description />
and the weblogic xml like this:
<description>WebLogic Descriptor</description>

However I am still getting name NameNotFoundException error.
Can you guys please give a hint for this. What else I am missing here.
Thanks a lot!
<Error> <HTTP> <101017> <[ServletContext(id=230937
6,name=AuctionWeb,context-path=/AuctionWeb)] Root cause of ServletException
javax.naming.LinkException: .
Root exception is javax.naming.LinkException: .
Root exception is javax.naming.NameNotFoundException: Unable to resolve 'app/ejb
/CustomerEJB.jar#CustomerEJB/local-home' Resolved: 'app/ejb' Unresolved:'Custome
rEJB.jar#CustomerEJB' ; remaining name 'CustomerEJB.jar#CustomerEJB/local-home'
I’m tired of walking, and will rest for a minute and grow some wheels. This is the promise of this tiny ad:
Master Gardener Program
    Bookmark Topic Watch Topic
  • New Topic