I’ve created a Dynamic Web Project in Eclipse. I have 2 beans, 1 @Entity and the other @Stateless. I’ve deployed the war to Geronimo 2.2.1 with Tomcat 6 with a warning:
Unresolved ejb reference "com.myconnection.servlet.AddServlet/srvc" in bean
"GeronimoEnc". Will attempt resolution again at runtime.
I have a form on a .jsp with an action to a servlet (AddServlet). The servlet is trying to reference my @Stateless bean (via interface). However, once I hit submit on my form to go to the servlet, I get this error:
java.lang.InstantiationException: Some objects to be injected were not found in jndi:
[javax.naming.NameNotFoundException: No EJB found for reference "com.
I also have my persistence.xml file in src/META-INF, I’m not positive if that’s where it should be.
What could I be doing wrong? Thanks
Support for deploying WAR files with EJBs is fixed (but possibly not available; see the following text) in Geronimo 3.0, going by bug report 5117. Going by this report, dependency injection in 2.2.1 is likely to fail.
There is one report on the mailing list, suggesting that Geronimo 3.0 M1 might be used for validating whether dependency injection works for EJBs deployed in a web-application; this is however against a query raised with respect to a failure on the same topic. Reproducing the salient contents of the mail:
Going all of the above, 3.0 M1 would be the release to attempt this at the moment, but there is surely some possibility of this feature being absent (given that bug 5117 does not appeared to be in the list of fixed bugs in the release notes).