2 Replies Latest reply on May 22, 2013 1:27 PM by defunkt

    Problem setting up Infinispan CDI

    defunkt Newbie

      Hello,

       

      I've been trying to use Infinispan's CDI module to inject a cache into a Callable for the distributed execution framework. I've added all jar files available from %ISPN_HOME%runtime-classpath.txt and %ISPN_HOME%\modules\cdi\runtime-classpath.txt - it should also be noted that some jars listed in the cdi module's runtime-classpath file are missing from their supposed locations - for example, logkit-1.0.1.jar and avalon-framework-4.1.3.jar.

       

      In any way, when I try to execute some task that injects a cache (like the example in https://docs.jboss.org/author/display/ISPN/Infinispan+Distributed+Execution+Framework - using @Inject and @Input annotations), i get the following error:

       

      java.util.concurrent.ExecutionException: java.lang.IllegalStateException: CDI not properly set up in your execution environment!

                at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)

                at java.util.concurrent.FutureTask.get(Unknown Source)

                at org.infinispan.distexec.DefaultExecutorService$DistributedTaskPart.innerGet(DefaultExecutorService.java:948)

                at org.infinispan.distexec.DefaultExecutorService$DistributedTaskPart.get(DefaultExecutorService.java:911)

                at test.exec.Test.main(Test.java:45)

      Caused by: java.lang.IllegalStateException: CDI not properly set up in your execution environment!

                at org.infinispan.cdi.InfinispanExtension.getBeanManagerController(InfinispanExtension.java:275)

                at org.infinispan.cdi.CDIDistributedTaskLifecycle.onPostExecute(CDIDistributedTaskLifecycle.java:35)

                at org.infinispan.distexec.spi.DistributedTaskLifecycleService.onPostExecute(DistributedTaskLifecycleService.java:67)

                at org.infinispan.distexec.DefaultExecutorService$DistributedTaskPart$2.doLocalInvoke(DefaultExecutorService.java:1104)

                at org.infinispan.distexec.DefaultExecutorService$DistributedTaskPart$2.call(DefaultExecutorService.java:1086)

                at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

                at java.util.concurrent.FutureTask.run(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

                at java.lang.Thread.run(Unknown Source)

       

      Now, I get this error even if I include *all* the jars from %ISPN_HOME%/lib in the classpath. I was wondering if this perhaps has anything to do with the missing jars. I'm running infinispan 5.2.1 final with the following configuration file:

       

      <infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"

                xmlns="urn:infinispan:config:5.2">

       

       

                <global>

                          <transport

                                    transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport"

                                    machineId="xxxxx"

                                    rackId="aaaaa"

                                    nodeName="zzzzz"

                                    clusterName="yyyyy">

                                    <properties>

                                              <property name="configurationFile" value="jgroups.xml" />

                                    </properties>

                          </transport>

                </global>

       

       

                <default>

                          <!-- Configure a synchronous replication cache -->

                          <clustering mode="dist">

                                    <sync />

                                    <hash numOwners="2" />

                          </clustering>

                </default>

       

       

                <namedCache name="defaultCache">

                          <transaction transactionMode="NON_TRANSACTIONAL"/>

       

       

                </namedCache>

       

       

      </infinispan>

       

       

      Thanks for any help!

      Gilad Ber

       

      EDIT: Clarification - these are the runtime-classpath files I referenced:

       

      1. from %ISPN_HOME%/ :

      $ISPN_HOME/lib/jgroups-3.2.7.Final.jar:$ISPN_HOME/lib/log4j-1.2.16.jar:$ISPN_HOME/lib/org.osgi.core-4.3.0.jar:$ISPN_HOME/lib/jboss-logging-3.1.1.GA.jar:$ISPN_HOME/lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar:$ISPN_HOME/lib/jcip-annotations-1.0.jar:$ISPN_HOME/lib/staxmapper-1.1.0.Final.jar:$ISPN_HOME/lib/jboss-marshalling-1.3.15.GA.jar:$ISPN_HOME/lib/jboss-marshalling-river-1.3.15.GA.jar

       

      2. from %ISPN_HOME%/modules/cdi:

      $ISPN_HOME/lib/jgroups-3.2.7.Final.jar:$ISPN_HOME/lib/infinispan-client-hotrod-5.2.1.Final.jar:$ISPN_HOME/lib/infinispan-core-5.2.1.Final.jar:$ISPN_HOME/lib/log4j-1.2.16.jar:$ISPN_HOME/lib/jsr250-api-1.0.jar:$ISPN_HOME/lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar:$ISPN_HOME/lib/infinispan-server-core-5.2.1.Final-tests.jar:$ISPN_HOME/lib/jcip-annotations-1.0.jar:$ISPN_HOME/lib/jboss-marshalling-1.3.15.GA.jar:$ISPN_HOME/lib/servlet-api-2.5.jar:$ISPN_HOME/lib/solder-logging-3.1.0.Final.jar:$ISPN_HOME/lib/jboss-interceptors-api_1.1_spec-1.0.0.Beta1.jar:$ISPN_HOME/lib/netty-3.6.1.Final.jar:$ISPN_HOME/lib/scala-library-2.10.0.jar:$ISPN_HOME/lib/logkit-1.0.1.jar:$ISPN_HOME/lib/jboss-marshalling-river-1.3.15.GA.jar:$ISPN_HOME/lib/avalon-framework-4.1.3.jar:$ISPN_HOME/lib/cdi-api-1.0-SP4.jar:$ISPN_HOME/lib/solder-impl-3.1.0.Final.jar:$ISPN_HOME/lib/cache-api-0.4.jar:$ISPN_HOME/lib/solder-api-3.1.0.Final.jar:$ISPN_HOME/lib/javax.inject-1.jar:$ISPN_HOME/lib/commons-pool-1.6.jar:$ISPN_HOME/lib/getopt-1.0.13.jar:$ISPN_HOME/lib/jboss-logging-3.1.1.GA.jar:$ISPN_HOME/lib/staxmapper-1.1.0.Final.jar

       

      where avalon-framework, logkit jars are missing and infinispan-server-core-5.2.1.Final.jar has no -tests suffix, as opposed to whats written in the classpath file.