1 2 3 4 Previous Next 47 Replies Latest reply on Aug 23, 2016 4:52 AM by tomjenkinson

    CDI BeanManager cannot find an instance of requested type

    manuel_uberti

      Following the https://github.com/jbosstm/quickstart/tree/master/compensating-transactions/travel-agent quickstart, I am trying to introduce compensation-based transactions in the project I am working on. The project runs on Wildfly 10.0, EJB 3.2 and Narayana 5.3.3.Final.

       

      I have a singleton EJB annotated like this:

       

      @Singleton
      @WebService(name="Narayana")
      @SOAPBinding(style = SOAPBinding.Style.RPC)
      
      
      
      
      

       

      The EJB overrides this method defined in a @Remote interface:

       

      @Compensatable(CompensationTransactionType.MANDATORY)
      @Transactional(Transactional.TxType.REQUIRES_NEW)
      public NarayanaResponse setNarayanaField(NarayanaRequest narayanaRequest);
      
      
      
      
      

       

      @Override
      @Compensatable
      @TxCompensate(CancelNarayana.class)
      @TxConfirm(ConfirmNarayana.class)
      public NarayanaResponse setNarayanaField(NarayanaRequest narayanaRequest) {
      ...
      }
      
      
      
      
      

       

      I also inject a couple of dependencies (always according to the quickstarts):

       

      @Inject
      private NarayanaData narayanaData;
      
      @Inject
      private CompensationManager compensationManager;
      
      
      
      
      

       

      Whenever I call the method via SoapUI (it's a webservice), I get this error after the transaction has ended correctly:

       

      08:41:53,448 ERROR [stderr] (default task-2) java.lang.IllegalStateException: CDI BeanManager cannot find an instance of requested type com.buddybank.mdw.ejb.narayana.handler.ConfirmNarayana
      
      08:41:53,449 ERROR [stderr] (default task-2)     at org.jboss.narayana.compensations.impl.BeanManagerUtil.createBeanInstance(BeanManagerUtil.java:21)
      
      08:41:53,449 ERROR [stderr] (default task-2)     at org.jboss.narayana.compensations.impl.ParticipantImpl.instantiate(ParticipantImpl.java:72)
      
      08:41:53,449 ERROR [stderr] (default task-2)     at org.jboss.narayana.compensations.impl.ParticipantImpl.close(ParticipantImpl.java:99)
      
      08:41:53,449 ERROR [stderr] (default task-2)     at org.jboss.narayana.compensations.impl.local.LocalParticipant.close(LocalParticipant.java:67)
      
      08:41:53,449 ERROR [stderr] (default task-2)     at com.arjuna.mwlabs.wscf.model.sagas.arjunacore.ParticipantRecord.topLevelCommit(ParticipantRecord.java:283)
      
      08:41:53,449 ERROR [stderr] (default task-2)     at com.arjuna.ats.arjuna.coordinator.BasicAction.doCommit(BasicAction.java:2868)
      
      08:41:53,449 ERROR [stderr] (default task-2)     at com.arjuna.ats.arjuna.coordinator.BasicAction.doCommit(BasicAction.java:2784)
      
      08:41:53,449 ERROR [stderr] (default task-2)     at com.arjuna.ats.arjuna.coordinator.BasicAction.phase2Commit(BasicAction.java:1853)
      
      08:41:53,450 ERROR [stderr] (default task-2)     at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1527)
      
      08:41:53,450 ERROR [stderr] (default task-2)     at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:96)
      
      08:41:53,450 ERROR [stderr] (default task-2)     at com.arjuna.mwlabs.wscf.model.sagas.arjunacore.BACoordinator.close(BACoordinator.java:192)
      
      08:41:53,450 ERROR [stderr] (default task-2)     at com.arjuna.mwlabs.wscf.model.sagas.arjunacore.CoordinatorControl.complete(CoordinatorControl.java:131)
      
      08:41:53,450 ERROR [stderr] (default task-2)     at com.arjuna.mwlabs.wscf11.model.sagas.arjunacore.SagasHLSImple.complete(SagasHLSImple.java:130)
      
      08:41:53,450 ERROR [stderr] (default task-2)     at com.arjuna.mwlabs.wsas.activity.ActivityImple.end(ActivityImple.java:289)
      
      08:41:53,450 ERROR [stderr] (default task-2)     at com.arjuna.mwlabs.wsas.UserActivityImple.end(UserActivityImple.java:261)
      
      08:41:53,450 ERROR [stderr] (default task-2)     at com.arjuna.mwlabs.wscf.model.sagas.arjunacore.CoordinatorServiceImple.close(CoordinatorServiceImple.java:170)
      
      08:41:53,450 ERROR [stderr] (default task-2)     at org.jboss.narayana.compensations.impl.local.LocalBAControler.closeBusinessActivity(LocalBAControler.java:34)
      
      08:41:53,450 ERROR [stderr] (default task-2)     at org.jboss.narayana.compensations.impl.local.LocalBAControler.completeBusinessActivity(LocalBAControler.java:55)
      
      08:41:53,450 ERROR [stderr] (default task-2)     at org.jboss.narayana.compensations.impl.CompensationInterceptorBase.invokeInOurTx(CompensationInterceptorBase.java:62)
      
      08:41:53,450 ERROR [stderr] (default task-2)     at org.jboss.narayana.compensations.impl.CompensationInterceptorRequired.intercept(CompensationInterceptorRequired.java:45)
      
      08:41:53,451 ERROR [stderr] (default task-2)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      
      08:41:53,451 ERROR [stderr] (default task-2)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      
      08:41:53,451 ERROR [stderr] (default task-2)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      
      08:41:53,451 ERROR [stderr] (default task-2)     at java.lang.reflect.Method.invoke(Method.java:498)
      
      08:41:53,451 ERROR [stderr] (default task-2)     at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74)
      
      08:41:53,451 ERROR [stderr] (default task-2)     at org.jboss.weld.interceptor.proxy.WeldInvocationContext.invokeNext(WeldInvocationContext.java:83)
      
      08:41:53,451 ERROR [stderr] (default task-2)     at org.jboss.weld.interceptor.proxy.WeldInvocationContext.proceed(WeldInvocationContext.java:115)
      
      08:41:53,452 ERROR [stderr] (default task-2)     at org.jboss.weld.bean.InterceptorImpl.intercept(InterceptorImpl.java:108)
      
      08:41:53,452 ERROR [stderr] (default task-2)     at org.jboss.as.weld.ejb.DelegatingInterceptorInvocationContext.proceed(DelegatingInterceptorInvocationContext.java:77)
      
      08:41:53,452 ERROR [stderr] (default task-2)     at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.delegateInterception(Jsr299BindingsInterceptor.java:68)
      
      08:41:53,452 ERROR [stderr] (default task-2)     at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:80)
      
      08:41:53,452 ERROR [stderr] (default task-2)     at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
      
      08:41:53,452 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
      
      08:41:53,452 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,452 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
      
      08:41:53,453 ERROR [stderr] (default task-2)     at com.buddybank.mdw.ejb.util.BusinessMetricInterceptor.intercept(BusinessMetricInterceptor.java:35)
      
      08:41:53,453 ERROR [stderr] (default task-2)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      
      08:41:53,453 ERROR [stderr] (default task-2)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      
      08:41:53,453 ERROR [stderr] (default task-2)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      
      08:41:53,453 ERROR [stderr] (default task-2)     at java.lang.reflect.Method.invoke(Method.java:498)
      
      08:41:53,453 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:89)
      
      08:41:53,453 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,453 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
      
      08:41:53,453 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,454 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
      
      08:41:53,454 ERROR [stderr] (default task-2)     at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
      
      08:41:53,454 ERROR [stderr] (default task-2)     at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
      
      08:41:53,454 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,454 ERROR [stderr] (default task-2)     at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
      
      08:41:53,454 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,454 ERROR [stderr] (default task-2)     at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
      
      08:41:53,454 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,455 ERROR [stderr] (default task-2)     at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      
      08:41:53,455 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
      
      08:41:53,455 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,455 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.singleton.SingletonComponentInstanceAssociationInterceptor.processInvocation(SingletonComponentInstanceAssociationInterceptor.java:53)
      
      08:41:53,455 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,455 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)
      
      08:41:53,455 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:327)
      
      08:41:53,456 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239)
      
      08:41:53,456 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,456 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
      
      08:41:53,456 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,456 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)
      
      08:41:53,456 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,456 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)
      
      08:41:53,456 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,456 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
      
      08:41:53,457 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.concurrency.ContainerManagedConcurrencyInterceptor.processInvocation(ContainerManagedConcurrencyInterceptor.java:110)
      
      08:41:53,457 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,457 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
      
      08:41:53,457 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,457 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66)
      
      08:41:53,457 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,457 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
      
      08:41:53,458 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,458 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)
      
      08:41:53,458 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,458 ERROR [stderr] (default task-2)     at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
      
      08:41:53,458 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,458 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
      
      08:41:53,458 ERROR [stderr] (default task-2)     at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:636)
      
      08:41:53,458 ERROR [stderr] (default task-2)     at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
      
      08:41:53,458 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,458 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
      
      08:41:53,458 ERROR [stderr] (default task-2)     at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
      
      08:41:53,459 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      
      08:41:53,459 ERROR [stderr] (default task-2)     at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      
      08:41:53,459 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)
      
      08:41:53,459 ERROR [stderr] (default task-2)     at org.jboss.as.webservices.invocation.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:137)
      
      08:41:53,459 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.JBossWSInvoker.performInvocation(JBossWSInvoker.java:169)
      
      08:41:53,460 ERROR [stderr] (default task-2)     at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
      
      08:41:53,460 ERROR [stderr] (default task-2)     at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:232)
      
      08:41:53,460 ERROR [stderr] (default task-2)     at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:85)
      
      08:41:53,460 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:145)
      
      08:41:53,460 ERROR [stderr] (default task-2)     at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
      
      08:41:53,460 ERROR [stderr] (default task-2)     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      
      08:41:53,460 ERROR [stderr] (default task-2)     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      
      08:41:53,460 ERROR [stderr] (default task-2)     at org.apache.cxf.interceptor.ServiceInvokerInterceptor$2.run(ServiceInvokerInterceptor.java:126)
      
      08:41:53,460 ERROR [stderr] (default task-2)     at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
      
      08:41:53,461 ERROR [stderr] (default task-2)     at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:131)
      
      08:41:53,461 ERROR [stderr] (default task-2)     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
      
      08:41:53,461 ERROR [stderr] (default task-2)     at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
      
      08:41:53,461 ERROR [stderr] (default task-2)     at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)
      
      08:41:53,461 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:108)
      
      08:41:53,461 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:134)
      
      08:41:53,461 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:88)
      
      08:41:53,461 ERROR [stderr] (default task-2)     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)
      
      08:41:53,461 ERROR [stderr] (default task-2)     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212)
      
      08:41:53,461 ERROR [stderr] (default task-2)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
      
      08:41:53,461 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:136)
      
      08:41:53,463 ERROR [stderr] (default task-2)     at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140)
      
      08:41:53,463 ERROR [stderr] (default task-2)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      
      08:41:53,463 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
      
      08:41:53,464 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
      
      08:41:53,464 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
      
      08:41:53,464 ERROR [stderr] (default task-2)     at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
      
      08:41:53,464 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      
      08:41:53,464 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
      
      08:41:53,464 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
      
      08:41:53,464 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      
      08:41:53,464 ERROR [stderr] (default task-2)     at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
      
      08:41:53,464 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
      
      08:41:53,464 ERROR [stderr] (default task-2)     at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
      
      08:41:53,464 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
      
      08:41:53,465 ERROR [stderr] (default task-2)     at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
      
      08:41:53,465 ERROR [stderr] (default task-2)     at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
      
      08:41:53,465 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      
      08:41:53,465 ERROR [stderr] (default task-2)     at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
      
      08:41:53,465 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      
      08:41:53,465 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      
      08:41:53,465 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)
      
      08:41:53,465 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)
      
      08:41:53,465 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
      
      08:41:53,465 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)
      
      08:41:53,465 ERROR [stderr] (default task-2)     at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
      
      08:41:53,466 ERROR [stderr] (default task-2)     at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)
      
      08:41:53,466 ERROR [stderr] (default task-2)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      
      08:41:53,466 ERROR [stderr] (default task-2)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      
      08:41:53,466 ERROR [stderr] (default task-2)     at java.lang.Thread.run(Thread.java:745)
      
      
      
      
      

       

      ConfirmNarayana.java looks like this:

       

      public class ConfirmNarayana implements ConfirmationHandler, Serializable {
      
          private static final long serialVersionUID = 4142315537188138812L;
      
          private static final Logger logger = LoggerFactory.getLogger(ConfirmNarayana.class);
      
          @Inject
          private NarayanaData narayanaData;
      
          @Override
          @Transactional(Transactional.TxType.REQUIRES_NEW)
          public void confirm() {
              logger.info("[NARAYANA] confirm: " + narayanaData.getNarayanaId());
          }
      
      }
      
      
      
      
      

       

      Note that the same happens if the transaction fails (i.e.: using compensationManager.setCompensateOnly()): CancelNarayana.java is never reached, and the exception is the same.

       

      If you need more details, please feel free to ask.

        • 1. Re: CDI BeanManager cannot find an instance of requested type
          gytis

          Hi, Manuel.

           

          FYI, since you're using WildFly 10.0.0.Final, you are actually using Narayana 5.2.12.Final, because that's the version which is distributed with that version of WildFly. However, that shouldn't have anything to do with your problem.

          This issue does seem odd and it might be caused by a bug in a classloader setup. Any chance you have this example on Github, so that it would be easier for me to debug?

          • 2. Re: CDI BeanManager cannot find an instance of requested type
            manuel_uberti

            Thank you.

            Unfortunately even this test case includes code from the company I work with, so I'm not able to share all the code.

            I can put the relevant code here, leaving out what I cannot share though:

             

            @Singleton
            @WebService(name = "Narayana")
            @SOAPBinding(style = SOAPBinding.Style.RPC)
            public class NarayanaFacade extends AbstractFacade implements NarayanaLocal {
            
                private static final Logger logger = LoggerFactory.getLogger(NarayanaFacade.class);
            
                @Inject
                private NarayanaData narayanaData;
            
                @Inject
                private CompensationManager compensationManager;
            
                @Override
                @Compensatable
                @TxCompensate(CancelNarayana.class)
                @TxConfirm(ConfirmNarayana.class)
                public NarayanaResponse setNarayanaField(NarayanaRequest narayanaRequest) {
            
                    // This one only does an insert into a two-column table
                    NarayanaResponse narayanaResponse = ResourceFactory.getNarayanaManager(narayanaRequest.getContext().getDomain())
                            .setNarayanaField(narayanaRequest);
            
                    String narayanaField = narayanaResponse.getNarayanaField();
            
                    // Test CancelNarayana
                    if (narayanaField.isEmpty()) {
                        compensationManager.setCompensateOnly();
                        return null;
                    }
            
                    narayanaData.setNarayanaId(Integer.valueOf(narayanaField));
            
                    logger.info("[NARAYANA] NarayanaFacade: " + narayanaField);
            
                    return narayanaResponse;
                }
            }
            
            
            

             

            @CompensationScoped
            public class NarayanaData implements Serializable {
            
                private static final long serialVersionUID = -752668644374140827L;
              
                private Integer narayanaId;
            
                public Integer getNarayanaId() {
                    return narayanaId;
                }
            
                public void setNarayanaId(Integer narayanaId) {
                    this.narayanaId = narayanaId;
                }
              
            }
            
            
            
            
            public class CancelNarayana implements CompensationHandler, Serializable {
            
                private static final long serialVersionUID = 9066062996117625642L;
            
                private static final Logger logger = LoggerFactory.getLogger(CancelNarayana.class);
            
                @Inject
                private NarayanaData narayanaData;
              
                @Override
                @Transactional(Transactional.TxType.REQUIRES_NEW)
                public void compensate() {
                    logger.info("[NARAYANA] cancel: " + narayanaData.getNarayanaId());
                }
            
            }
            
            
            

             

            I added this to my pom.xml:

            <properties>
            ...
               <version.narajana>5.3.3.Final</version.narajana>
            ...
            </properties
            
            
            

             

                        <dependency>
                            <groupId>org.jboss.narayana.compensations</groupId>
                            <artifactId>compensations</artifactId>
                            <version>${version.narajana}</version>
                        </dependency>
            
                        <dependency>
                            <groupId>org.jboss.narayana.jta</groupId>
                            <artifactId>narayana-jta</artifactId>
                            <version>${version.narajana}</version>
                        </dependency>
            
            
            
            • 3. Re: CDI BeanManager cannot find an instance of requested type
              gytis

              You are deploying this service to WildFly and then calling it from the remote client. Is that correct? If so, is that client running on the same WildFly instance? Is it deployed separately from the service?

              • 4. Re: CDI BeanManager cannot find an instance of requested type
                manuel_uberti

                The client is SoapUI generated, and the service is deployed on WildFly.

                • 5. Re: CDI BeanManager cannot find an instance of requested type
                  gytis

                  manuel_uberti, since your current code cannot be shared, could you please provide a small reproducer and share it on github in order for me to verify and debug the issue? Including both code for server and generated client.

                  • 6. Re: CDI BeanManager cannot find an instance of requested type
                    manuel_uberti

                    gytis sorry for the delay. This is the code: https://github.com/manuel-uberti/narayana-test

                    A SoapUI request XML is also included.

                    • 7. Re: CDI BeanManager cannot find an instance of requested type
                      gytis

                      Any chance you could add the steps to build and execute it in order to reproduce the failure?

                      • 8. Re: CDI BeanManager cannot find an instance of requested type
                        manuel_uberti

                        This is what I usually do:

                         

                        • I build the EAR from Eclipse, using Project>Build all
                        • in Server view, I right-click on the ear and choose Full publish (WildFly is already setup in Eclipse)
                        • I start the server in debug mode (again, from Eclipse)
                        • in SoapUI, I have a Project with this wsdl: http://localhost:8080/mdw-ejb_0.5.5-SNAP/Narayana?wsdl
                        • the service only has one operation: setNarayanaField, so I add a New Request right-clicking on the operation
                        • I copy and paste the XML provided in the repository
                        • in SoapUI I hit Alt+Enter
                        • 9. Re: CDI BeanManager cannot find an instance of requested type
                          manuel_uberti

                          gytis I don't know if this can help, but this is what I have in my pom.xml with regard to Narayana:

                           

                                  <dependency>
                                      <groupId>org.jboss.narayana.xts</groupId>
                                      <artifactId>jbossxts</artifactId>
                                      <classifier>api</classifier>
                                      <exclusions>
                                          <exclusion>
                                              <groupId>org.jboss.logging</groupId>
                                              <artifactId>jboss-logging-spi</artifactId>
                                          </exclusion>
                                      </exclusions>
                                  </dependency>
                          
                                  <dependency>
                                      <groupId>org.jboss.narayana.jta</groupId>
                                      <artifactId>narayana-jta</artifactId>
                                      <scope>provided</scope>
                                  </dependency>
                          
                                  <dependency>
                                      <groupId>org.jboss.spec.javax.transaction</groupId>
                                      <artifactId>jboss-transaction-api_1.2_spec</artifactId>
                                      <scope>provided</scope>
                                  </dependency>
                                 
                                  <dependency>
                                      <groupId>org.jboss.spec.javax.annotation</groupId>
                                      <artifactId>jboss-annotations-api_1.1_spec</artifactId>
                                      <scope>provided</scope>
                                  </dependency>
                          
                          

                           

                          Note: travel-agent example works fine, so it is me doing something bad.

                          • 10. Re: CDI BeanManager cannot find an instance of requested type
                            gytis

                            Isn't there a pom.xml for GitHub - manuel-uberti/narayana-test: Test with Narayana library? In order to run tests straight from the console with mvn command?

                            • 11. Re: CDI BeanManager cannot find an instance of requested type
                              manuel_uberti

                              No, sorry, I've just extracted the relevant code from our project in order to publish it on GitHub. Also, I don't run test from console, but only with SoapUI.

                              • 12. Re: CDI BeanManager cannot find an instance of requested type
                                gytis

                                It would be great if you could provide a self contained reproducer which could be executed from the console or deployed to WildFly. Preferably as small as possible and with the least possible amount of external dependencies such as SoapUI, JPA etc.. This would make it much easier to find the exact problem.

                                Because it would require a lot of investigation on how to build, deploy, and test your provided code as it stands.

                                • 13. Re: CDI BeanManager cannot find an instance of requested type
                                  manuel_uberti

                                  Thanks gytis, I'll see what I can do and update the github repository as soon as I have what you need.

                                  • 14. Re: CDI BeanManager cannot find an instance of requested type
                                    manuel_uberti

                                    gytis I added everything I could here: https://github.com/manuel-uberti/narayana-test

                                     

                                    I was able to run "mvn package" with success.

                                     

                                    Edit: please wait. I'll try to deploy the EAR to be sure you can do it too.

                                    1 2 3 4 Previous Next