Jimmy Ray wrote:
Ok...I have the integration working, I think. I can
test everything OK with the call to
"http://localhost:8080/openejb_loader-0.9.2/". I can
even lookup my bean. Now when I try the JSP or
servlet I seem to be getting a JNDI NamingException,
"Naming Exception - Name "ejb/hello" not found". I
know that this might be a Tomcat JNDI question now,
but I thought that I would still post it here...
Exactly, but there's one caveat. Read on...
When you see the error in your browser it means that Tomcat JNDI manager
couldn't lookup the ejb/hello reference *before* even OpenEJB JNDI
manager could be ask for it. That's Tomcat server.xml configuration issue.
However, when you see the error while running a standalone client it
means that OpenEJB JNDI manager couldn't lookup the reference. That's
the difference. I saw that your client uses ejb/hello reference whereas
it should've used "Hello". It should work unless the bean has not been
deployed properly. Use telnet localhost 4200 and the lookup command to
traverse the JNDI tree.
Now, it's time to tell you about the caveat. It seems that I cannot
trace what's going on in LoaderServlet due to missing OpenEJB sources
before moving to Codehaus. So, I spent the whole day wondering what
might have been wrong that my line breakpoints weren't picked up. Shame
on me!
So, I'm not fully certain if that perticular version of OpenEJB 0.9.2
really works as far as the OpenEJB Tomcat resource factory is concerned.
There're two solutions to the problem - one is to build the latest
OpenEJB sources (soon to be release as a release candidate) or to use
another approach to connect Tomcat webapps to OpenEJB - see
http://www.openejb.org/tomcat.html. As you might've noticed the page
refers to the release built from sources, which is highly recommended as
much of the reported troubles in 0.9.2 are already fixed in that version.
Jacek