Re: [Resin-interest] CanDI unable to inject @Stateless
As a followup, the old-style JNDI registration does exist in Resin 4.0.5. It requires an ejb-server in the cluster which looks like: resin cluster ejb-server jndi-prefix=java:comp/env/ejb/ ... Basic ejb-ref support will be added to 4.0.6, although the full support won't be ready until 4.0.8. -- Scott Scott Ferguson wrote: smallufo wrote: In Resin 4.0.4 I follow this step : http://www.caucho.com/resin/doc/resin-ejb.xtp#Hello, World http://www.caucho.com/resin/doc/resin-ejb.xtp#Hello,%20World Do you have a META-INF/ejb-jar.xml? We're currently requiring that file as a marker for classpath scanning (although it appears that we should always scan for those classes.) - Scott public interface PersonDao { //... methods... } @Stateless public class PersonServiceImpl implements PersonService , Serializable { @Inject private PersonDao personDao; ... } The dao can be injected to Servlet WITHOUT a @Stateless annotation , but when add @Stateless , it throws : com.caucho.config.ConfigException: foo.HelloServlet.personService: javax.enterprise.inject.UnsatisfiedResolutionException: Can't find a bean for 'interface foo.PersonService' because no beans implementing that class have been registered with the injection manager InjectManager[web-app:http://test.smallufo.com/testapp-1]. at com.caucho.config.ConfigException.create(ConfigException.java:102) at com.caucho.config.ConfigException.create(ConfigException.java:125) at com.caucho.config.inject.InjectionTargetImpl$FieldInjectProgram.inject(InjectionTargetImpl.java:809) at com.caucho.config.inject.InjectionTargetImpl.inject(InjectionTargetImpl.java:266) at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:1260) at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:1142) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:98) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:183) at com.caucho.server.webapp.AccessLogFilterChain.doFilter(AccessLogFilterChain.java:103) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:286) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:780) at com.caucho.server.connection.TcpConnection.dispatchRequest(TcpConnection.java:600) at com.caucho.server.connection.TcpConnection.handleRequestsImpl(TcpConnection.java:566) at com.caucho.server.connection.TcpConnection.handleRequests(TcpConnection.java:519) at com.caucho.server.connection.TcpConnection$AcceptTask.doTask(TcpConnection.java:1100) at com.caucho.server.connection.TcpConnection$ConnectionReadTask.runThread(TcpConnection.java:1037) at com.caucho.server.connection.TcpConnection$AcceptTask.run(TcpConnection.java:1068) at com.caucho.util.ThreadPool$PoolThread.runTasks(ThreadPool.java:901) at com.caucho.util.ThreadPool$PoolThread.run(ThreadPool.java:866) Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Can't find a bean for 'interface foo.PersonService' because no beans implementing that class have been registered with the injection manager InjectManager[web-app:http://test.smallufo.com/testapp-1]. at com.caucho.config.inject.InjectManager.unsatisfiedException(InjectManager.java:1389) at com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:1545) at com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:1523) at com.caucho.config.inject.InjectManager.getInjectableReference(InjectManager.java:1476) at com.caucho.config.inject.InjectionTargetImpl$FieldInjectProgram.inject(InjectionTargetImpl.java:805) ... 16 more Http[2] HTTP/1.1 500 Internal Server Error ___ 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
Re: [Resin-interest] CanDI unable to inject @Stateless
smallufo wrote: 2010/3/24 smallufo small...@gmail.com mailto:small...@gmail.com Mmm... There is no ejb-jar.xml in META-INF/ After adding an empty ejb-jar.xml , it still doesn't work. No matter 4.0.4 or 4.0.5 BTW I tried a lot of ejb-jar.xml settings , but non works... Is there any working example for this simple scenario ? Thanks. Can you add an ejb-server/ to your resin.xml (inside the cluster). That's a Resin bug because the ejb-server/ wasn't supposed to be required any more. -- 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
Re: [Resin-interest] CanDI unable to inject @Stateless
2010/3/25 Scott Ferguson f...@caucho.com Thanks. Can you add an ejb-server/ to your resin.xml (inside the cluster). That's a Resin bug because the ejb-server/ wasn't supposed to be required any more. -- Scott 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. 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 But I cannot find this EJB in the InitialContext (under wicket) , it throws : Caused by: java.lang.RuntimeException: Could not locate ejb of class [[interface data.PersonService]] and name [[ejb/personService]] at org.wicketstuff.javaee.JavaEEBeanLocator.lookupEjb(JavaEEBeanLocator.java:131) at org.wicketstuff.javaee.JavaEEBeanLocator.locateProxyTarget(JavaEEBeanLocator.java:109) at org.apache.wicket.proxy.LazyInitProxyFactory$JdkHandler.invoke(LazyInitProxyFactory.java:412) at org.apache.wicket.proxy.$Proxy51.getPerson(Unknown Source) at wicket.CurrentPage.init(CurrentPage.java:33) ... 31 more Caused by: javax.naming.NameNotFoundException: java:comp/env/ejb/personService at com.caucho.naming.ContextImpl.lookupImpl(ContextImpl.java:205) at com.caucho.naming.ContextImpl.lookup(ContextImpl.java:157) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.wicketstuff.javaee.JavaEEBeanLocator.lookupEjb(JavaEEBeanLocator.java:124) ... 35 more Where goes wrong ? Isn't the mappedName=ejb/personService hooked into java:comp/env ? Why resin (4.0.4) throws NameNotFoundException ? ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] CanDI unable to inject @Stateless
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
Re: [Resin-interest] CanDI unable to inject @Stateless
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-nameSession/ejb-name ejb-classdata.PersonServiceImpl/ejb-class ejb-ref ejb-ref-nameejb/personService/ejb-ref-name ejb-ref-typeSession/ejb-ref-type homedata.PersonService/home remotedata.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-namepersonService/ejb-name ejb-classdata.PersonServiceImpl/ejb-class ejb-local-ref ejb-ref-nameejb/personService/ejb-ref-name ejb-ref-typeSession/ejb-ref-type local-homedata.PersonService/local-home localdata.PersonServiceImpl/local /ejb-local-ref /session EjbLocalRef[ejb/personService, null, null] init NameNotFoundException: java:comp/env/ejb/personService -- !-- session ejb-namepersonService/ejb-name homedata.PersonService/home remotedata.PersonServiceImpl/remote ejb-classdata.PersonServiceImpl/ejb-class session-typeStateless/session-type transaction-typeBean/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
[Resin-interest] CanDI unable to inject @Stateless
In Resin 4.0.4 I follow this step : http://www.caucho.com/resin/doc/resin-ejb.xtp#Hello, World public interface PersonDao { //... methods... } @Stateless public class PersonServiceImpl implements PersonService , Serializable { @Inject private PersonDao personDao; ... } The dao can be injected to Servlet WITHOUT a @Stateless annotation , but when add @Stateless , it throws : com.caucho.config.ConfigException: foo.HelloServlet.personService: javax.enterprise.inject.UnsatisfiedResolutionException: Can't find a bean for 'interface foo.PersonService' because no beans implementing that class have been registered with the injection manager InjectManager[web-app: http://test.smallufo.com/testapp-1]. at com.caucho.config.ConfigException.create(ConfigException.java:102) at com.caucho.config.ConfigException.create(ConfigException.java:125) at com.caucho.config.inject.InjectionTargetImpl$FieldInjectProgram.inject(InjectionTargetImpl.java:809) at com.caucho.config.inject.InjectionTargetImpl.inject(InjectionTargetImpl.java:266) at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:1260) at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:1142) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:98) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:183) at com.caucho.server.webapp.AccessLogFilterChain.doFilter(AccessLogFilterChain.java:103) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:286) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:780) at com.caucho.server.connection.TcpConnection.dispatchRequest(TcpConnection.java:600) at com.caucho.server.connection.TcpConnection.handleRequestsImpl(TcpConnection.java:566) at com.caucho.server.connection.TcpConnection.handleRequests(TcpConnection.java:519) at com.caucho.server.connection.TcpConnection$AcceptTask.doTask(TcpConnection.java:1100) at com.caucho.server.connection.TcpConnection$ConnectionReadTask.runThread(TcpConnection.java:1037) at com.caucho.server.connection.TcpConnection$AcceptTask.run(TcpConnection.java:1068) at com.caucho.util.ThreadPool$PoolThread.runTasks(ThreadPool.java:901) at com.caucho.util.ThreadPool$PoolThread.run(ThreadPool.java:866) Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Can't find a bean for 'interface foo.PersonService' because no beans implementing that class have been registered with the injection manager InjectManager[web-app:http://test.smallufo.com/testapp-1]. at com.caucho.config.inject.InjectManager.unsatisfiedException(InjectManager.java:1389) at com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:1545) at com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:1523) at com.caucho.config.inject.InjectManager.getInjectableReference(InjectManager.java:1476) at com.caucho.config.inject.InjectionTargetImpl$FieldInjectProgram.inject(InjectionTargetImpl.java:805) ... 16 more Http[2] HTTP/1.1 500 Internal Server Error ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] CanDI unable to inject @Stateless
Can you show your resin-web.xml? The first thing that leaps out at me (and may be okay, but looks odd) is: com.caucho.config.ConfigException: *foo.HelloServlet.personService*: javax.enterprise.inject.UnsatisfiedResolutionException: Can't find a bean for 'interface *foo.PersonService*'. Aaron On 3/23/2010 12:52 PM, smallufo wrote: In Resin 4.0.4 I follow this step : http://www.caucho.com/resin/doc/resin-ejb.xtp#Hello, World http://www.caucho.com/resin/doc/resin-ejb.xtp#Hello,%20World public interface PersonDao { //... methods... } @Stateless public class PersonServiceImpl implements PersonService , Serializable { @Inject private PersonDao personDao; ... } The dao can be injected to Servlet WITHOUT a @Stateless annotation , but when add @Stateless , it throws : com.caucho.config.ConfigException: foo.HelloServlet.personService: javax.enterprise.inject.UnsatisfiedResolutionException: Can't find a bean for 'interface foo.PersonService' because no beans implementing that class have been registered with the injection manager InjectManager[web-app:http://test.smallufo.com/testapp-1]. at com.caucho.config.ConfigException.create(ConfigException.java:102) at com.caucho.config.ConfigException.create(ConfigException.java:125) at com.caucho.config.inject.InjectionTargetImpl$FieldInjectProgram.inject(InjectionTargetImpl.java:809) at com.caucho.config.inject.InjectionTargetImpl.inject(InjectionTargetImpl.java:266) at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:1260) at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:1142) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:98) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:183) at com.caucho.server.webapp.AccessLogFilterChain.doFilter(AccessLogFilterChain.java:103) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:286) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:780) at com.caucho.server.connection.TcpConnection.dispatchRequest(TcpConnection.java:600) at com.caucho.server.connection.TcpConnection.handleRequestsImpl(TcpConnection.java:566) at com.caucho.server.connection.TcpConnection.handleRequests(TcpConnection.java:519) at com.caucho.server.connection.TcpConnection$AcceptTask.doTask(TcpConnection.java:1100) at com.caucho.server.connection.TcpConnection$ConnectionReadTask.runThread(TcpConnection.java:1037) at com.caucho.server.connection.TcpConnection$AcceptTask.run(TcpConnection.java:1068) at com.caucho.util.ThreadPool$PoolThread.runTasks(ThreadPool.java:901) at com.caucho.util.ThreadPool$PoolThread.run(ThreadPool.java:866) Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Can't find a bean for 'interface foo.PersonService' because no beans implementing that class have been registered with the injection manager InjectManager[web-app:http://test.smallufo.com/testapp-1]. at com.caucho.config.inject.InjectManager.unsatisfiedException(InjectManager.java:1389) at com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:1545) at com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:1523) at com.caucho.config.inject.InjectManager.getInjectableReference(InjectManager.java:1476) at com.caucho.config.inject.InjectionTargetImpl$FieldInjectProgram.inject(InjectionTargetImpl.java:805) ... 16 more Http[2] HTTP/1.1 500 Internal Server Error ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] CanDI unable to inject @Stateless
2010/3/24 Aaron Freeman aaron.free...@layerz.com Can you show your resin-web.xml? I only define database tags there : web-app xmlns=http://caucho.com/ns/resin; database jndi-name=jdbc/data driver type=com.mysql.jdbc.Driver urljdbc:mysql://db/data?useUnicode=trueamp;characterEncoding=UTF8/url userxx/user passwordxx/password /driver max-connections100/max-connections /database /web-app ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] CanDI unable to inject @Stateless
smallufo wrote: In Resin 4.0.4 I follow this step : http://www.caucho.com/resin/doc/resin-ejb.xtp#Hello, World http://www.caucho.com/resin/doc/resin-ejb.xtp#Hello,%20World Do you have a META-INF/ejb-jar.xml? We're currently requiring that file as a marker for classpath scanning (although it appears that we should always scan for those classes.) - Scott public interface PersonDao { //... methods... } @Stateless public class PersonServiceImpl implements PersonService , Serializable { @Inject private PersonDao personDao; ... } The dao can be injected to Servlet WITHOUT a @Stateless annotation , but when add @Stateless , it throws : com.caucho.config.ConfigException: foo.HelloServlet.personService: javax.enterprise.inject.UnsatisfiedResolutionException: Can't find a bean for 'interface foo.PersonService' because no beans implementing that class have been registered with the injection manager InjectManager[web-app:http://test.smallufo.com/testapp-1]. at com.caucho.config.ConfigException.create(ConfigException.java:102) at com.caucho.config.ConfigException.create(ConfigException.java:125) at com.caucho.config.inject.InjectionTargetImpl$FieldInjectProgram.inject(InjectionTargetImpl.java:809) at com.caucho.config.inject.InjectionTargetImpl.inject(InjectionTargetImpl.java:266) at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:1260) at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:1142) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:98) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:183) at com.caucho.server.webapp.AccessLogFilterChain.doFilter(AccessLogFilterChain.java:103) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:286) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:780) at com.caucho.server.connection.TcpConnection.dispatchRequest(TcpConnection.java:600) at com.caucho.server.connection.TcpConnection.handleRequestsImpl(TcpConnection.java:566) at com.caucho.server.connection.TcpConnection.handleRequests(TcpConnection.java:519) at com.caucho.server.connection.TcpConnection$AcceptTask.doTask(TcpConnection.java:1100) at com.caucho.server.connection.TcpConnection$ConnectionReadTask.runThread(TcpConnection.java:1037) at com.caucho.server.connection.TcpConnection$AcceptTask.run(TcpConnection.java:1068) at com.caucho.util.ThreadPool$PoolThread.runTasks(ThreadPool.java:901) at com.caucho.util.ThreadPool$PoolThread.run(ThreadPool.java:866) Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Can't find a bean for 'interface foo.PersonService' because no beans implementing that class have been registered with the injection manager InjectManager[web-app:http://test.smallufo.com/testapp-1]. at com.caucho.config.inject.InjectManager.unsatisfiedException(InjectManager.java:1389) at com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:1545) at com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:1523) at com.caucho.config.inject.InjectManager.getInjectableReference(InjectManager.java:1476) at com.caucho.config.inject.InjectionTargetImpl$FieldInjectProgram.inject(InjectionTargetImpl.java:805) ... 16 more Http[2] HTTP/1.1 500 Internal Server Error ___ 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
Re: [Resin-interest] CanDI unable to inject @Stateless
Hi! I have the problem with CanDI's tag @Startup in 4.0.4. I upgrade to 4.0.5 and now it works. So I suppose you may try 4.0.5. May be it fix? ;) В Wed, 24 Mar 2010 01:52:17 +0800 smallufo small...@gmail.com пишет: In Resin 4.0.4 I follow this step : http://www.caucho.com/resin/doc/resin-ejb.xtp#Hello, World public interface PersonDao { //... methods... } @Stateless public class PersonServiceImpl implements PersonService , Serializable { @Inject private PersonDao personDao; ... } The dao can be injected to Servlet WITHOUT a @Stateless annotation , but when add @Stateless , it throws : com.caucho.config.ConfigException: foo.HelloServlet.personService: javax.enterprise.inject.UnsatisfiedResolutionException: Can't find a bean for 'interface foo.PersonService' because no beans implementing that class have been registered with the injection manager InjectManager[web-app: http://test.smallufo.com/testapp-1]. at com.caucho.config.ConfigException.create(ConfigException.java:102) at com.caucho.config.ConfigException.create(ConfigException.java:125) at com.caucho.config.inject.InjectionTargetImpl$FieldInjectProgram.inject(InjectionTargetImpl.java:809) at com.caucho.config.inject.InjectionTargetImpl.inject(InjectionTargetImpl.java:266) at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:1260) at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:1142) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:98) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:183) at com.caucho.server.webapp.AccessLogFilterChain.doFilter(AccessLogFilterChain.java:103) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:286) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:780) at com.caucho.server.connection.TcpConnection.dispatchRequest(TcpConnection.java:600) at com.caucho.server.connection.TcpConnection.handleRequestsImpl(TcpConnection.java:566) at com.caucho.server.connection.TcpConnection.handleRequests(TcpConnection.java:519) at com.caucho.server.connection.TcpConnection$AcceptTask.doTask(TcpConnection.java:1100) at com.caucho.server.connection.TcpConnection$ConnectionReadTask.runThread(TcpConnection.java:1037) at com.caucho.server.connection.TcpConnection$AcceptTask.run(TcpConnection.java:1068) at com.caucho.util.ThreadPool$PoolThread.runTasks(ThreadPool.java:901) at com.caucho.util.ThreadPool$PoolThread.run(ThreadPool.java:866) Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Can't find a bean for 'interface foo.PersonService' because no beans implementing that class have been registered with the injection manager InjectManager[web-app:http://test.smallufo.com/testapp-1]. at com.caucho.config.inject.InjectManager.unsatisfiedException(InjectManager.java:1389) at com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:1545) at com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:1523) at com.caucho.config.inject.InjectManager.getInjectableReference(InjectManager.java:1476) at com.caucho.config.inject.InjectionTargetImpl$FieldInjectProgram.inject(InjectionTargetImpl.java:805) ... 16 more Http[2] HTTP/1.1 500 Internal Server Error -- Виталий Бердинских UR6LAD 73 72! ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] CanDI unable to inject @Stateless
Mmm... There is no ejb-jar.xml in META-INF/ After adding an empty ejb-jar.xml , it still doesn't work. No matter 4.0.4 or 4.0.5 2010/3/24 Scott Ferguson f...@caucho.com smallufo wrote: In Resin 4.0.4 I follow this step : http://www.caucho.com/resin/doc/resin-ejb.xtp#Hello, World http://www.caucho.com/resin/doc/resin-ejb.xtp#Hello,%20World Do you have a META-INF/ejb-jar.xml? We're currently requiring that file as a marker for classpath scanning (although it appears that we should always scan for those classes.) - Scott public interface PersonDao { //... methods... } @Stateless public class PersonServiceImpl implements PersonService , Serializable { @Inject private PersonDao personDao; ... } The dao can be injected to Servlet WITHOUT a @Stateless annotation , but when add @Stateless , it throws : com.caucho.config.ConfigException: foo.HelloServlet.personService: javax.enterprise.inject.UnsatisfiedResolutionException: Can't find a bean for 'interface foo.PersonService' because no beans implementing that class have been registered with the injection manager InjectManager[web-app:http://test.smallufo.com/testapp-1]. at com.caucho.config.ConfigException.create(ConfigException.java:102) at com.caucho.config.ConfigException.create(ConfigException.java:125) at com.caucho.config.inject.InjectionTargetImpl$FieldInjectProgram.inject(InjectionTargetImpl.java:809) at com.caucho.config.inject.InjectionTargetImpl.inject(InjectionTargetImpl.java:266) at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:1260) at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:1142) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:98) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:183) at com.caucho.server.webapp.AccessLogFilterChain.doFilter(AccessLogFilterChain.java:103) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:286) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:780) at com.caucho.server.connection.TcpConnection.dispatchRequest(TcpConnection.java:600) at com.caucho.server.connection.TcpConnection.handleRequestsImpl(TcpConnection.java:566) at com.caucho.server.connection.TcpConnection.handleRequests(TcpConnection.java:519) at com.caucho.server.connection.TcpConnection$AcceptTask.doTask(TcpConnection.java:1100) at com.caucho.server.connection.TcpConnection$ConnectionReadTask.runThread(TcpConnection.java:1037) at com.caucho.server.connection.TcpConnection$AcceptTask.run(TcpConnection.java:1068) at com.caucho.util.ThreadPool$PoolThread.runTasks(ThreadPool.java:901) at com.caucho.util.ThreadPool$PoolThread.run(ThreadPool.java:866) Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Can't find a bean for 'interface foo.PersonService' because no beans implementing that class have been registered with the injection manager InjectManager[web-app:http://test.smallufo.com/testapp-1]. at com.caucho.config.inject.InjectManager.unsatisfiedException(InjectManager.java:1389) at com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:1545) at com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:1523) at com.caucho.config.inject.InjectManager.getInjectableReference(InjectManager.java:1476) at com.caucho.config.inject.InjectionTargetImpl$FieldInjectProgram.inject(InjectionTargetImpl.java:805) ... 16 more Http[2] HTTP/1.1 500 Internal Server Error ___ 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
Re: [Resin-interest] CanDI unable to inject @Stateless
2010/3/24 smallufo small...@gmail.com Mmm... There is no ejb-jar.xml in META-INF/ After adding an empty ejb-jar.xml , it still doesn't work. No matter 4.0.4 or 4.0.5 BTW I tried a lot of ejb-jar.xml settings , but non works... Is there any working example for this simple scenario ? ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest