aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes NamingException during lookup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "NamingException during lookup" Watch "NamingException during lookup" New topic
Author

NamingException during lookup

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9351
    
    2

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?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9351
    
    2

Any thoughts on this guys?
Mark Garland
Ranch Hand

Joined: Nov 11, 2006
Posts: 226
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


28/06/06 - SCJP - 69%, 05/06/07 - SCWCD - 92%, 28/02/08 - IBM DB2 v9 Fundamentals (Exam 730) - 87%, 18/11/08 - IBM DB2 v9 DBA (Exam 731) - 89%, 26/02/11 - SCBCD - 88%
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NamingException during lookup