• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NamingException during lookup

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I have a scenario where in I"m doing a lookup for a Stateless session bean. This Stateless session bean extends an abstract class and in the abstract class i"m doing some DI on some resources using the @Resource annotation. Now what happens is, when I deploy this to my Weblogic, it goes off fine and when I try to access this SSB, I run into a NamingException. The JNDI path for the resource that I"m injecting in my abstract class is something like x.y.z.myAbstractClass#myAbstractClass and the JNDI name of the SSB is something like x.y.u.mySSB#mySSB. When I look at the stact trace, it says that unable to resolve x.y.u.mySSB#mySSB, resolved till x.y.

After having a look at this I started to think that this might be because of the DI which might have failed in the abstract class. But there is no way for me to check this. I tried seeing the JNDI tree but everytime I try to view it my system crashed and I really did not want to waste time on that. So ranchers is my guess correct? because I remember form the specs that if the DI fails then the bean instance is discarded. But does DI happens during deployment or during run time?
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any thoughts on this guys?
 
Mark Garland
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jothi,

Good to see you again - I remember you from the SCWCD forum - did you ever take it and pass?

I'm very new to EJB, so here's my stab.

Could you do something like below from your client:

Then, iterate over the NamingEnumeration to list out everything it can see.

From that, you could tell if you bean was bound to JNDI correctly, and whether the name you were using was correct.

Just an idea...

MG
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic