smallufo wrote: > > > 2010/3/25 Scott Ferguson <[email protected] <mailto:[email protected]>> > > Thank you , it works ! > > public class HelloServlet extends HttpServlet { > @EJB / @Inject both works > private PersonService personService; > > Now I can inject into Servlet with @EJB and @Inject , though I don't > know the difference , the console dump seems nothing different. Well, you can think of @EJB as the obsolete JavaEE injection method, although @EJB does have JNDI side-effects. > > BTW , what is the populated JNDI name of the Stateless Bean ? > in my code : > > @Stateless(mappedName="ejb/personService") > @Local(PersonService.class) > public class PersonServiceImpl implements PersonService , Serializable > > Where goes wrong ? > Isn't the mappedName="ejb/personService" hooked into "java:comp/env" ? > Why resin (4.0.4) throws NameNotFoundException ? This is kind of complicated. Technically (according to the spec), the @Stateless does not register with JNDI at all - that's a Resin-specific feature. The JNDI registration occurs either with an <ejb-ref> or a @EJB annotation somewhere.
But that's a part of the spec that we haven't completely tested yet. We have an open bug at http://bugs.caucho.com/view.php?id=3964 to restore Resin's old behavior for backward compatibility. -- Scott > ------------------------------------------------------------------------ > > _______________________________________________ > resin-interest mailing list > [email protected] > http://maillist.caucho.com/mailman/listinfo/resin-interest > _______________________________________________ resin-interest mailing list [email protected] http://maillist.caucho.com/mailman/listinfo/resin-interest
