Ok, I need some old timers here.
I've been tasked with installing an old JSP/EJB app on 10 yr old technology for demo purposes, and I have things mostly working. One thing that is tripping me up is we seem to get random NamingExceptions.
I'm perplexed, because it seems like another underlying error is causing these, but stack traces only reveal that there was a NamingException.
The code that generates these exceptions looks something like this:
The same type of code runs everywhere and seems to be successful...
My question is how can I get at the root cause of these errors
or what common problems can cause NamingExceptions that I am not thinking of?
Wow. WebSphere 3.5 and remote EJBs. I worked with WebSphere 3.5 for a couple months right out of college.
First thing I would check: does "HomeName" exist in the JNDI? You can check n the admin console. Also what does HomeName contain? In particular is it something like "LocationEntityHome" or "ejb/LocationEntityHome" or ....
Also, you say the same type of code runs elsewhere. Is that in the same ear? same ejb jar? same bean?
I'm hoping some of these questions lead us towards an answers.
Yes, the name is correct in JNDI. It is actually using a constant defined in another class, which is indeed correct.
There are 29 beans in total deployed to the app server, and all of the code to find them looks like the code I posted with the exception of changing names and such to lookup the object needed.
The actual exception I get is:
I fear, however, that there is another root cause that this error is hiding.
We are talking to a db2 database which is occasionally flaky. We've had error before where the database failed to service a request for one reason or another, yet the only error we get on the Java side are the NamingException errors.
So I believe that the problem does not lie in JNDI, but somewhere deeper.
What I'm looking for is a method to somehow get at the root cause of this.
I'm also spoiled by modern visual debuggers, so I'm not sure even what debugger I can use to try to attach to this process.
Thanks for listening...
Everyone is a villain in someone else's story. Especially this devious tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop