0 Replies Latest reply on Dec 17, 2010 8:22 AM by Thomas Woelfle

    Stateless Session Beans and CDI constructor injection

    Thomas Woelfle Newbie

      Hi *,

       

      I've tried to use CDI constructor based dependency injection for a Stateless Session Bean with JBoss 6.0 CR1. According to issue  https://issues.jboss.org/browse/JBAS-8279 this should work. But when trying to lookup the session bean the exception below is thrown.

       

      javax.ejb.EJBException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchMethodException: de.patronas.test.TestDependencyInjection.<init>()
      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:183)
      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:251)
      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349)
      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209)
      at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:369)
      at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:898)
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
      Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchMethodException: de.patronas.test.TestDependencyInjection.<init>()
      at org.jboss.ejb3.interceptors.container.AbstractContainer.invokeCallback(AbstractContainer.java:262)
      at org.jboss.ejb3.EJBContainer.invokeCallback(EJBContainer.java:1351)
      at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1362)
      at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1374)
      at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:92)
      at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:62)
      at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:57)
      at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:54)
      at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:86)
      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:91)
      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247)
      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349)
      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209)
      at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:369)
      at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:898)
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
      at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:216)
      at org.jboss.remoting.Client.invoke(Client.java:1961)
      at org.jboss.remoting.Client.invoke(Client.java:804)
      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.async.impl.interceptor.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:121)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
      at $Proxy9.invoke(Unknown Source)
      at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)
      at $Proxy8.saySomething(Unknown Source)
      at de.patronas.test.CDITest.testConstructorInjection(CDITest.java:50)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.async.impl.interceptor.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:121)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
      at $Proxy9.invoke(Unknown Source)
      at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)
      at $Proxy8.saySomething(Unknown Source)
      at de.patronas.test.CDITest.testConstructorInjection(CDITest.java:50)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: de.patronas.test.TestDependencyInjection.<init>()
      at org.jboss.ejb3.interceptors.container.LifecycleMethodInterceptorsInvocation.<init>(LifecycleMethodInterceptorsInvocation.java:85)
      at org.jboss.ejb3.interceptors.container.AbstractContainer.invokeCallback(AbstractContainer.java:255)
      at org.jboss.ejb3.EJBContainer.invokeCallback(EJBContainer.java:1351)
      at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1362)
      at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1374)
      at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:92)
      at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:62)
      at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:57)
      at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:54)
      at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:86)
      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:91)
      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247)
      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349)
      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209)
      at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:369)
      at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)
      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:898)
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
      Caused by: java.lang.NoSuchMethodException: de.patronas.test.TestDependencyInjection.<init>()
      at java.lang.Class.getConstructor0(Class.java:2706)
      at java.lang.Class.getConstructor(Class.java:1657)
      at org.jboss.ejb3.interceptors.container.LifecycleMethodInterceptorsInvocation.<init>(LifecycleMethodInterceptorsInvocation.java:78)
      ... 42 more

       

      javax.ejb.EJBException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchMethodException: test.cdi.TestDependencyInjection.<init>()

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:183)

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:251)

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349)

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209)

      at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:369)

      at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)

      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)

      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)

      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:898)

      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)

      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)

      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)

      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)

      Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NoSuchMethodException: test.cdi.TestDependencyInjection.<init>()

      at org.jboss.ejb3.interceptors.container.AbstractContainer.invokeCallback(AbstractContainer.java:262)

      at org.jboss.ejb3.EJBContainer.invokeCallback(EJBContainer.java:1351)

      at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1362)

      at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1374)

      at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:92)

      at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:62)

      at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:57)

      at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:54)

      at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:86)

      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:91)

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247)

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349)

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209)

      at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:369)

      at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)

      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)

      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)

      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:898)

      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)

      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)

      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)

      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)

      at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:216)

      at org.jboss.remoting.Client.invoke(Client.java:1961)

      at org.jboss.remoting.Client.invoke(Client.java:804)

      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:60)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.async.impl.interceptor.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:121)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)

      at $Proxy9.invoke(Unknown Source)

      at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)

      at $Proxy8.saySomething(Unknown Source)

      at test.cdi.CDITest.testConstructorInjection(CDITest.java:45)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)

      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)

      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:72)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.async.impl.interceptor.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:121)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.security.client.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:65)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)

      at $Proxy9.invoke(Unknown Source)

      at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185)

      at $Proxy8.saySomething(Unknown Source)

      at test.cdi.CDITest.testConstructorInjection(CDITest.java:45)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)

      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)

      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: test.cdi.TestDependencyInjection.<init>()

      at org.jboss.ejb3.interceptors.container.LifecycleMethodInterceptorsInvocation.<init>(LifecycleMethodInterceptorsInvocation.java:85)

      at org.jboss.ejb3.interceptors.container.AbstractContainer.invokeCallback(AbstractContainer.java:255)

      at org.jboss.ejb3.EJBContainer.invokeCallback(EJBContainer.java:1351)

      at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1362)

      at org.jboss.ejb3.EJBContainer.invokePostConstruct(EJBContainer.java:1374)

      at org.jboss.ejb3.pool.AbstractPool.create(AbstractPool.java:92)

      at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:62)

      at org.jboss.ejb3.InfinitePool.get(InfinitePool.java:57)

      at org.jboss.ejb3.pool.ThreadlocalPool.create(ThreadlocalPool.java:54)

      at org.jboss.ejb3.pool.ThreadlocalPool.get(ThreadlocalPool.java:86)

      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:58)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:91)

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247)

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349)

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209)

      at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86)

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)

      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:369)

      at org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)

      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)

      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)

      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:898)

      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791)

      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744)

      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548)

      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)

      Caused by: java.lang.NoSuchMethodException: test.cdi.TestDependencyInjection.<init>()

      at java.lang.Class.getConstructor0(Class.java:2706)

      at java.lang.Class.getConstructor(Class.java:1657)

      at org.jboss.ejb3.interceptors.container.LifecycleMethodInterceptorsInvocation.<init>(LifecycleMethodInterceptorsInvocation.java:78)

      ... 42 more

       

       

      It seems that JBoss still tries to create the session bean instance using a default constructor which does not exist. The code of the Session Bean is the following:

       

       

      package test.cdi;

       

      import javax.ejb.Stateless;

      import javax.inject.Inject;

       

      @Stateless

      public class TestDependencyInjection implements TestDependencyInjectionRemote {

       

      private final SayHello hello;

       

      @Inject

      public TestDependencyInjection(final SayHello hello) {

      this.hello = hello;

      }

       

      @Override

      public String saySomething() {

      return hello.saySomething();

      }

      }

      Has anyone an idea what I am doing wrong?
      Regards,
      Thomas