4 Replies Latest reply on Jun 29, 2014 8:19 AM by Grégory Bataille

    Issue with distributed computation and CDI

    Grégory Bataille Newbie

      Hi everyone,

       

      so here is the thing. I'm trying to work on a POC about distributed cache as well as distributed execution with Infinispan.

      After having troubles with JBoss 7 and Infinispan 5, I'm now working on Wilfly (8.0.0) and Infinispan 6.0.1.

       

      I have a local cluster of 2 JBoss instances with the same application deployed. the JBoss has a distributed cache configured

                      <cache-container name="rtpm-cache-container" default-cache="rtpm-cache-position">

                          <transport lock-timeout="60000"/>

                          <distributed-cache name="rtpm-cache-portfolio" start="EAGER" mode="ASYNC" owners="1"/>

                          <distributed-cache name="rtpm-cache-position" start="EAGER" mode="ASYNC" owners="1"/>

                          <distributed-cache name="rtpm-position-index-ticker" start="EAGER" mode="ASYNC" owners="1"/>

                      </cache-container>

       

      The good news is that I have something that finally mostly works. My cache is balanced on 2 nodes properly and I can execute distributed computation (with a distributed callable on some cache entries).

      My distributed task simply outputs the cache entry as well as the node it's currently running on (to prove I'm indeed in distributed execution).

       

              DistributedExecutorService des = new DefaultExecutorService(cacheManager.getPositionCache());

              List<Future<Integer>> results = des.submitEverywhere(new DistributedQuoteProcessor(), cacheManager.getPositionTickerIndex().get("GOOG").toArray());

       

      public class DistributedQuoteProcessor implements DistributedCallable<Long, Position, Integer>, Serializable {

          Cache<Long, Position> cache;

          Set<Long> ids;

       

       

          @Override

          public void setEnvironment(Cache<Long, Position> longPositionCache, Set<Long> longs) {

              cache = longPositionCache;

              ids = longs;

          }

       

       

          @Override

          public Integer call() throws Exception {

              int counter = 0;

              for (Long id : ids) {

                  Position pos = cache.get(id);

                  System.out.println("key " + id);

                  System.out.println(cache.getAdvancedCache().getDistributionManager().locate(id));

                  System.out.println(System.getProperty("jboss.server.name"));

                  System.out.println(pos);

                  counter++;

              }

              System.out.println(counter);

              return counter;

          }

      }

      the cacheManager thingy is just a helper for my several caches and it injects itself the cache container from JNDI

      public class CacheManager {

          @Resource(lookup="java:jboss/infinispan/container/rtpm-cache-container")

          private CacheContainer container;

      Oh, by the way, I'm using CDI everywhere to get the cache and pass values.

       

      So here is the deal. I have tested a lot of scenario, and here are my conclusions. I start my 2 nodes cluster. I load some data into the cache from any or both of the nodes. I can play with both nodes as I wish, the cache behaves as expected. Node A can read properly values stored on itself or on node B and vice versa.

      Now, if I call the rest endpoint that launches the distributed computation from one node (any of A or B), it will work like a charm, my callable outputting data from both nodes.

      But if I now try to launch the same computation through the same rest endpoint, but from the other node, it fails with a huge stack that ends up with the following:

       

      Caused by: java.lang.IllegalStateException: Unable to find BeanManager. Please ensure that you configured the CDI implementation of your choice properly.

       

      In all the test I have done, it does not matter which node we are talking about. The first works, the second does not, whichever I chose. And after the first works and the second fails with the exception above, I can re-execute successfully the treatment on the first node.

       

      Any idea what I'm missing?

       

      Thanks

        • 1. Re: Issue with distributed computation and CDI
          Vijay Bhaskar Chintalapati Newbie

          Grégory,


          Can you share the code of your Rest Endpoint and also include the stack trace ? Perhaps whichever node serves the first request is doing something that cannot be repeated again, whether in the same node or elsewhere and hence your could would be helpful in that sense.

          • 2. Re: Re: Issue with distributed computation and CDI
            Grégory Bataille Newbie

            sure, here goes

            Hope this helps

             

            The CacheManager wrapper

            @Singleton

            @Named

            public class CacheManager {

                @Resource(lookup="java:jboss/infinispan/container/rtpm-cache-container")

                private CacheContainer container;


                public AdvancedCache<String, ArrayList<Long>> getPositionTickerIndex() {

                    //Have to specify the classloader for the serializer to find the model classes

                    Cache<String, ArrayList<Long>> cache = container.getCache("rtpm-position-index-ticker");

                    return cache.getAdvancedCache().with(this.getClass().getClassLoader());

                }

             

                public AdvancedCache<Long, Portfolio> getPortfolioCache() {

                    //Have to specify the classloader for the serializer to find the model classes

                    Cache<Long, Portfolio> cache = container.getCache("rtpm-cache-portfolio");

                    return cache.getAdvancedCache().with(this.getClass().getClassLoader());

                }

             

                public AdvancedCache<Long, Position> getPositionCache() {

                    //Have to specify the classloader for the serializer to find the model classes

                    Cache<Long, Position> cache = container.getCache("rtpm-cache-position");

                    return cache.getAdvancedCache().with(this.getClass().getClassLoader());

                }

            }

             

            The Rest endpoint

            @Path("/quotes")

            @Singleton

            @WatchPerformance

            public class Quote implements Serializable {

                private static Logger logger = Logger.getLogger(Quote.class);

             

                @Inject

                CacheManager cacheManager;

             

                @GET

                @Path("/distributed")

                public Response receiveQuoteDistributed() {

                    DistributedExecutorService des = new DefaultExecutorService(cacheManager.getPositionCache());

                    List<Future<Integer>> results = des.submitEverywhere(new DistributedQuoteProcessor(), cacheManager.getPositionTickerIndex().get("GOOG").toArray());

                    for (Future<Integer> result : results) {

                        try {

                            System.out.println(result.get());

                        } catch (InterruptedException e) {

                            e.printStackTrace();

                        } catch (ExecutionException e) {

                            e.printStackTrace();

                        }

                    }

                    return Response.temporaryRedirect(UriBuilder.fromPath("../simulateQuotes.jsf").build()).build();

                }

             

            The callable

            public class DistributedQuoteProcessor implements DistributedCallable<Long, Position, Integer>, Serializable {

                Cache<Long, Position> cache;

                Set<Long> ids;

             

                @Override

                public void setEnvironment(Cache<Long, Position> longPositionCache, Set<Long> longs) {

                    cache = longPositionCache;

                    ids = longs;

                }

             

                @Override

                public Integer call() throws Exception {

                    int counter = 0;

                    for (Long id : ids) {

                        Position pos = cache.get(id);

                        System.out.println("key " + id);

                        System.out.println(cache.getAdvancedCache().getDistributionManager().locate(id));

                        System.out.println(System.getProperty("jboss.server.name"));

                        System.out.println(pos);

                        counter++;

                    }

                    System.out.println(counter);

                    return counter;

                }

            }

             

             

             

            As for the very big stack trace:

            [Server:server-two] 11:12:20,069 ERROR [stderr] (default task-1) java.util.concurrent.ExecutionException: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from master:server-one/rtpm-cache-container, see cause for remote stack trace

            [Server:server-two] 11:12:20,069 ERROR [stderr] (default task-1)        at java.util.concurrent.FutureTask.report(FutureTask.java:122)

            [Server:server-two] 11:12:20,070 ERROR [stderr] (default task-1)        at java.util.concurrent.FutureTask.get(FutureTask.java:202)

            [Server:server-two] 11:12:20,070 ERROR [stderr] (default task-1)        at org.infinispan.distexec.DefaultExecutorService$DistributedTaskPart.innerGet(DefaultExecutorService.java:903)

            [Server:server-two] 11:12:20,070 ERROR [stderr] (default task-1)        at org.infinispan.distexec.DefaultExecutorService$DistributedTaskPart.get(DefaultExecutorService.java:880)

            [Server:server-two] 11:12:20,070 ERROR [stderr] (default task-1)        at com.octo.randd.bigdata.rtpm.service.Quote.receiveQuoteDistributed(Quote.java:99)

            [Server:server-two] 11:12:20,071 ERROR [stderr] (default task-1)        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            [Server:server-two] 11:12:20,071 ERROR [stderr] (default task-1)        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

            [Server:server-two] 11:12:20,071 ERROR [stderr] (default task-1)        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

            [Server:server-two] 11:12:20,071 ERROR [stderr] (default task-1)        at java.lang.reflect.Method.invoke(Method.java:606)

            [Server:server-two] 11:12:20,072 ERROR [stderr] (default task-1)        at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)

            [Server:server-two] 11:12:20,072 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,072 ERROR [stderr] (default task-1)        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

            [Server:server-two] 11:12:20,072 ERROR [stderr] (default task-1)        at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)

            [Server:server-two] 11:12:20,073 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,073 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)

            [Server:server-two] 11:12:20,073 ERROR [stderr] (default task-1)        at org.jboss.as.weld.ejb.DelegatingInterceptorInvocationContext.proceed(DelegatingInterceptorInvocationContext.java:87)

            [Server:server-two] 11:12:20,073 ERROR [stderr] (default task-1)        at com.octo.randd.bigdata.rtpm.aop.PerformanceMonitor.monitorPerf(PerformanceMonitor.java:22)

            [Server:server-two] 11:12:20,074 ERROR [stderr] (default task-1)        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            [Server:server-two] 11:12:20,074 ERROR [stderr] (default task-1)        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

            [Server:server-two] 11:12:20,074 ERROR [stderr] (default task-1)        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

            [Server:server-two] 11:12:20,074 ERROR [stderr] (default task-1)        at java.lang.reflect.Method.invoke(Method.java:606)

            [Server:server-two] 11:12:20,075 ERROR [stderr] (default task-1)        at org.jboss.weld.interceptor.proxy.SimpleMethodInvocation.invoke(SimpleMethodInvocation.java:30)

            [Server:server-two] 11:12:20,075 ERROR [stderr] (default task-1)        at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNext(AbstractInterceptionChain.java:103)

            [Server:server-two] 11:12:20,075 ERROR [stderr] (default task-1)        at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNextInterceptor(AbstractInterceptionChain.java:81)

            [Server:server-two] 11:12:20,076 ERROR [stderr] (default task-1)        at org.jboss.weld.bean.InterceptorImpl.intercept(InterceptorImpl.java:105)

            [Server:server-two] 11:12:20,076 ERROR [stderr] (default task-1)        at org.jboss.as.weld.ejb.DelegatingInterceptorInvocationContext.proceed(DelegatingInterceptorInvocationContext.java:77)

            [Server:server-two] 11:12:20,076 ERROR [stderr] (default task-1)        at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.delegateInterception(Jsr299BindingsInterceptor.java:68)

            [Server:server-two] 11:12:20,076 ERROR [stderr] (default task-1)        at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:80)

            [Server:server-two] 11:12:20,076 ERROR [stderr] (default task-1)        at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)

            [Server:server-two] 11:12:20,077 ERROR [stderr] (default task-1)        at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)

            [Server:server-two] 11:12:20,077 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,077 ERROR [stderr] (default task-1)        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

            [Server:server-two] 11:12:20,078 ERROR [stderr] (default task-1)        at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)

            [Server:server-two] 11:12:20,078 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,078 ERROR [stderr] (default task-1)        at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)

            [Server:server-two] 11:12:20,078 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,079 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)

            [Server:server-two] 11:12:20,079 ERROR [stderr] (default task-1)        at org.jboss.as.ejb3.concurrency.ContainerManagedConcurrencyInterceptor.processInvocation(ContainerManagedConcurrencyInterceptor.java:104)

            [Server:server-two] 11:12:20,079 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,079 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)

            [Server:server-two] 11:12:20,080 ERROR [stderr] (default task-1)        at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46)

            [Server:server-two] 11:12:20,080 ERROR [stderr] (default task-1)        at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)

            [Server:server-two] 11:12:20,080 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,081 ERROR [stderr] (default task-1)        at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)

            [Server:server-two] 11:12:20,081 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,081 ERROR [stderr] (default task-1)        at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

            [Server:server-two] 11:12:20,081 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,082 ERROR [stderr] (default task-1)        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

            [Server:server-two] 11:12:20,082 ERROR [stderr] (default task-1)        at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)

            [Server:server-two] 11:12:20,082 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,082 ERROR [stderr] (default task-1)        at org.jboss.as.ejb3.component.singleton.SingletonComponentInstanceAssociationInterceptor.processInvocation(SingletonComponentInstanceAssociationInterceptor.java:52)

            [Server:server-two] 11:12:20,083 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,083 ERROR [stderr] (default task-1)        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273)

            [Server:server-two] 11:12:20,083 ERROR [stderr] (default task-1)        at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:340)

            [Server:server-two] 11:12:20,083 ERROR [stderr] (default task-1)        at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239)

            [Server:server-two] 11:12:20,083 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,083 ERROR [stderr] (default task-1)        at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

            [Server:server-two] 11:12:20,084 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,084 ERROR [stderr] (default task-1)        at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)

            [Server:server-two] 11:12:20,084 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,084 ERROR [stderr] (default task-1)        at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95)

            [Server:server-two] 11:12:20,085 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,085 ERROR [stderr] (default task-1)        at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)

            [Server:server-two] 11:12:20,085 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,085 ERROR [stderr] (default task-1)        at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)

            [Server:server-two] 11:12:20,085 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,085 ERROR [stderr] (default task-1)        at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

            [Server:server-two] 11:12:20,086 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,086 ERROR [stderr] (default task-1)        at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)

            [Server:server-two] 11:12:20,086 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,086 ERROR [stderr] (default task-1)        at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

            [Server:server-two] 11:12:20,086 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,086 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)

            [Server:server-two] 11:12:20,087 ERROR [stderr] (default task-1)        at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)

            [Server:server-two] 11:12:20,087 ERROR [stderr] (default task-1)        at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)

            [Server:server-two] 11:12:20,087 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,087 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)

            [Server:server-two] 11:12:20,087 ERROR [stderr] (default task-1)        at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

            [Server:server-two] 11:12:20,088 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,088 ERROR [stderr] (default task-1)        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

            [Server:server-two] 11:12:20,088 ERROR [stderr] (default task-1)        at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)

            [Server:server-two] 11:12:20,088 ERROR [stderr] (default task-1)        at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)

            [Server:server-two] 11:12:20,089 ERROR [stderr] (default task-1)        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

            [Server:server-two] 11:12:20,089 ERROR [stderr] (default task-1)        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

            [Server:server-two] 11:12:20,089 ERROR [stderr] (default task-1)        at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)

            [Server:server-two] 11:12:20,089 ERROR [stderr] (default task-1)        at com.octo.randd.bigdata.rtpm.service.Quote$$$view2.receiveQuoteDistributed(Unknown Source)

            [Server:server-two] 11:12:20,090 ERROR [stderr] (default task-1)        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            [Server:server-two] 11:12:20,090 ERROR [stderr] (default task-1)        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

            [Server:server-two] 11:12:20,090 ERROR [stderr] (default task-1)        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

            [Server:server-two] 11:12:20,090 ERROR [stderr] (default task-1)        at java.lang.reflect.Method.invoke(Method.java:606)

            [Server:server-two] 11:12:20,090 ERROR [stderr] (default task-1)        at org.jboss.weld.util.reflection.Reflections.invokeAndUnwrap(Reflections.java:401)

            [Server:server-two] 11:12:20,091 ERROR [stderr] (default task-1)        at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:99)

            [Server:server-two] 11:12:20,091 ERROR [stderr] (default task-1)        at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56)

            [Server:server-two] 11:12:20,091 ERROR [stderr] (default task-1)        at org.jboss.weld.bean.proxy.InjectionPointPropagatingEnterpriseTargetBeanInstance.invoke(InjectionPointPropagatingEnterpriseTargetBeanInstance.java:65)

            [Server:server-two] 11:12:20,091 ERROR [stderr] (default task-1)        at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:100)

            [Server:server-two] 11:12:20,092 ERROR [stderr] (default task-1)        at com.octo.randd.bigdata.rtpm.service.Quote$Proxy$_$$_Weld$EnterpriseProxy$.receiveQuoteDistributed(Unknown Source)

            [Server:server-two] 11:12:20,092 ERROR [stderr] (default task-1)        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            [Server:server-two] 11:12:20,092 ERROR [stderr] (default task-1)        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

            [Server:server-two] 11:12:20,092 ERROR [stderr] (default task-1)        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

            [Server:server-two] 11:12:20,093 ERROR [stderr] (default task-1)        at java.lang.reflect.Method.invoke(Method.java:606)

            [Server:server-two] 11:12:20,093 ERROR [stderr] (default task-1)        at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137)

            [Server:server-two] 11:12:20,093 ERROR [stderr] (default task-1)        at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:280)

            [Server:server-two] 11:12:20,094 ERROR [stderr] (default task-1)        at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:234)

            [Server:server-two] 11:12:20,094 ERROR [stderr] (default task-1)        at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:221)

            [Server:server-two] 11:12:20,094 ERROR [stderr] (default task-1)        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)

            [Server:server-two] 11:12:20,094 ERROR [stderr] (default task-1)        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)

            [Server:server-two] 11:12:20,095 ERROR [stderr] (default task-1)        at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)

            [Server:server-two] 11:12:20,095 ERROR [stderr] (default task-1)        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)

            [Server:server-two] 11:12:20,095 ERROR [stderr] (default task-1)        at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)

            [Server:server-two] 11:12:20,095 ERROR [stderr] (default task-1)        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

            [Server:server-two] 11:12:20,096 ERROR [stderr] (default task-1)        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)

            [Server:server-two] 11:12:20,096 ERROR [stderr] (default task-1)        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)

            [Server:server-two] 11:12:20,096 ERROR [stderr] (default task-1)        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

            [Server:server-two] 11:12:20,096 ERROR [stderr] (default task-1)        at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

            [Server:server-two] 11:12:20,096 ERROR [stderr] (default task-1)        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

            [Server:server-two] 11:12:20,096 ERROR [stderr] (default task-1)        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)

            [Server:server-two] 11:12:20,097 ERROR [stderr] (default task-1)        at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)

            [Server:server-two] 11:12:20,097 ERROR [stderr] (default task-1)        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)

            [Server:server-two] 11:12:20,097 ERROR [stderr] (default task-1)        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)

            [Server:server-two] 11:12:20,097 ERROR [stderr] (default task-1)        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)

            [Server:server-two] 11:12:20,097 ERROR [stderr] (default task-1)        at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

            [Server:server-two] 11:12:20,098 ERROR [stderr] (default task-1)        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

            [Server:server-two] 11:12:20,098 ERROR [stderr] (default task-1)        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

            [Server:server-two] 11:12:20,098 ERROR [stderr] (default task-1)        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

            [Server:server-two] 11:12:20,098 ERROR [stderr] (default task-1)        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)

            [Server:server-two] 11:12:20,098 ERROR [stderr] (default task-1)        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)

            [Server:server-two] 11:12:20,098 ERROR [stderr] (default task-1)        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)

            [Server:server-two] 11:12:20,099 ERROR [stderr] (default task-1)        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)

            [Server:server-two] 11:12:20,099 ERROR [stderr] (default task-1)        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)

            [Server:server-two] 11:12:20,099 ERROR [stderr] (default task-1)        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168)

            [Server:server-two] 11:12:20,099 ERROR [stderr] (default task-1)        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)

            [Server:server-two] 11:12:20,100 ERROR [stderr] (default task-1)        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

            [Server:server-two] 11:12:20,100 ERROR [stderr] (default task-1)        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

            [Server:server-two] 11:12:20,100 ERROR [stderr] (default task-1)        at java.lang.Thread.run(Thread.java:744)

            [Server:server-two] 11:12:20,101 ERROR [stderr] (default task-1) Caused by: org.infinispan.remoting.RemoteException: ISPN000217: Received exception from master:server-one/rtpm-cache-container, see cause for remote stack trace

            [Server:server-two] 11:12:20,101 ERROR [stderr] (default task-1)        at org.infinispan.remoting.transport.AbstractTransport.checkResponse(AbstractTransport.java:41)

            [Server:server-two] 11:12:20,101 ERROR [stderr] (default task-1)        at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.processSingleCall(CommandAwareRpcDispatcher.java:362)

            [Server:server-two] 11:12:20,101 ERROR [stderr] (default task-1)        at org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.invokeRemoteCommand(CommandAwareRpcDispatcher.java:167)

            [Server:server-two] 11:12:20,101 ERROR [stderr] (default task-1)        at org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeRemotely(JGroupsTransport.java:521)

            [Server:server-two] 11:12:20,101 ERROR [stderr] (default task-1)        at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:281)

            [Server:server-two] 11:12:20,102 ERROR [stderr] (default task-1)        at org.infinispan.remoting.rpc.RpcManagerImpl$2.call(RpcManagerImpl.java:315)

            [Server:server-two] 11:12:20,102 ERROR [stderr] (default task-1)        at java.util.concurrent.FutureTask.run(FutureTask.java:262)

            [Server:server-two] 11:12:20,102 ERROR [stderr] (default task-1)        ... 3 more

            [Server:server-two] 11:12:20,102 ERROR [stderr] (default task-1) Caused by: java.lang.IllegalStateException: Unable to find BeanManager. Please ensure that you configured the CDI implementation of your choice properly.

            [Server:server-two] 11:12:20,102 ERROR [stderr] (default task-1)        at org.infinispan.cdi.util.BeanManagerProvider.getBeanManager(BeanManagerProvider.java:179)

            [Server:server-two] 11:12:20,103 ERROR [stderr] (default task-1)        at org.infinispan.cdi.CDIDistributedTaskLifecycle.onPostExecute(CDIDistributedTaskLifecycle.java:35)

            [Server:server-two] 11:12:20,103 ERROR [stderr] (default task-1)        at org.infinispan.distexec.spi.DistributedTaskLifecycleService.onPostExecute(DistributedTaskLifecycleService.java:49)

            [Server:server-two] 11:12:20,103 ERROR [stderr] (default task-1)        at org.infinispan.commands.read.DistributedExecuteCommand.perform(DistributedExecuteCommand.java:101)

            [Server:server-two] 11:12:20,103 ERROR [stderr] (default task-1)        at org.infinispan.remoting.InboundInvocationHandlerImpl.handleInternal(InboundInvocationHandlerImpl.java:95)

            [Server:server-two] 11:12:20,103 ERROR [stderr] (default task-1)        at org.infinispan.remoting.InboundInvocationHandlerImpl.access$000(InboundInvocationHandlerImpl.java:50)

            [Server:server-two] 11:12:20,103 ERROR [stderr] (default task-1)        at org.infinispan.remoting.InboundInvocationHandlerImpl$2.run(InboundInvocationHandlerImpl.java:172)

            [Server:server-two] 11:12:20,104 ERROR [stderr] (default task-1)        ... 3 more

            • 3. Re: Re: Re: Issue with distributed computation and CDI
              Vijay Bhaskar Chintalapati Newbie

              I gave it a try, not sure how much of it will help you. The stack trace takes you here : infinispan/cdi/extension/src/main/java/org/infinispan/cdi/util/BeanManagerProvider.java at master · infinispan/infinispa…  .

               

              Tracing backwards from here at line #306 you should see the entry below :

               

              return (BeanManager) new InitialContext().lookup("java:comp/BeanManager");
              

               

              And this could turn out to be null if the app is missing a beans.xml file in the WAR file under WEB-INF. Can you confirm you have one in the suggested location ?

              • 4. Re: Re: Re: Issue with distributed computation and CDI
                Grégory Bataille Newbie

                Hey Vijay,

                 

                sorry, was out for a while. I do have one indeed (in fact I have to cause I'm declaring a JBOSS interceptor

                 

                <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                    xsi:schemaLocation="

                        http://java.sun.com/xml/ns/javaee

                        http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">

                    <interceptors>

                        <class>com.octo.randd.bigdata.rtpm.aop.PerformanceMonitor</class>

                    </interceptors>

                </beans>