Thanks , but I tried some settings in 'ejb-jar.xml' , but still cannot get the Stateless bean from JNDI , Here are some of my settings :
<!-- <session> <ejb-name>Session</ejb-name> <ejb-class>data.PersonServiceImpl</ejb-class> <ejb-ref> <ejb-ref-name>ejb/personService</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>data.PersonService</home> <remote>data.PersonServiceImpl</remote> </ejb-ref> </session> BeanType[com.caucho.config.types.DescriptionGroupConfig]: conflicting attribute for 'xxx' between SetterAttribute NameNotFoundException: java:comp/env/ejb/personService --> <!-- <session> <ejb-name>personService</ejb-name> <ejb-class>data.PersonServiceImpl</ejb-class> <ejb-local-ref> <ejb-ref-name>ejb/personService</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <local-home>data.PersonService</local-home> <local>data.PersonServiceImpl</local> </ejb-local-ref> </session> EjbLocalRef[ejb/personService, null, null] init NameNotFoundException: java:comp/env/ejb/personService --> <!-- <session> <ejb-name>personService</ejb-name> <home>data.PersonService</home> <remote>data.PersonServiceImpl</remote> <ejb-class>data.PersonServiceImpl</ejb-class> <session-type>Stateless</session-type> <transaction-type>Bean</transaction-type> </session> Not working com.caucho.config.ConfigException: 'data.PersonService' must extend EJBHome. <home> interfaces must extend javax.ejb.EJBHome. --> Is there any valid settings I can refer to (I've searched a lot ) ? 2010/3/25 Scott Ferguson <f...@caucho.com> > smallufo wrote: > > > > > > 2010/3/25 Scott Ferguson <f...@caucho.com <mailto:f...@caucho.com>> > > > > 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 > > resin-interest@caucho.com > > http://maillist.caucho.com/mailman/listinfo/resin-interest > > > > > > _______________________________________________ > resin-interest mailing list > resin-interest@caucho.com > http://maillist.caucho.com/mailman/listinfo/resin-interest >
_______________________________________________ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest