1 Reply Latest reply on Dec 28, 2016 11:39 AM by nicolas duminil

    Can't use Wildfly 10 infinispan

    nicolas duminil Master

      Hello,

       

      I have the following infinispan configuration:

       

              <cache-container name="ldap" default-cache="ldap-cache">
                    <local-cache name="ldap-cache"/>
              </cache-container>

       

      And I'm trying to use it as follows:

       

        @CacheResult(cacheName="ldap-cache")

        public Company findByDistinguishedName(Name name)

        {

          return companyRepo.findOne(name);

        }

       

      But it raises the following exception:

       

      15:25:48,418 ERROR (default task-13) ejb3.invocation: WFLYEJB0034: EJB Invocation failed on component CompanyRepoImpl for method public abstract fr.docapost.ldap.model.Company fr.docapost.ldap.session.CompanyRepoLocal.findByDistinguishedName(javax.naming.Name): javax.ejb.EJBException: java.lang.NullPointerException

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:187) [wildfly-ejb3-10.1.0.Final.jar:10.1.0.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277) [wildfly-ejb3-10.1.0.Final.jar:10.1.0.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:327) [wildfly-ejb3-10.1.0.Final.jar:10.1.0.Final]

          at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239) [wildfly-ejb3-10.1.0.Final.jar:10.1.0.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-10.1.0.Final.jar:10.1.0.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:47) [wildfly-ejb3-10.1.0.Final.jar:10.1.0.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100) [wildfly-ejb3-10.1.0.Final.jar:10.1.0.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.deployment.processors.StartupAwaitInterceptor.processInvocation(StartupAwaitInterceptor.java:22) [wildfly-ejb3-10.1.0.Final.jar:10.1.0.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-10.1.0.Final.jar:10.1.0.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:67) [wildfly-ejb3-10.1.0.Final.jar:10.1.0.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54) [wildfly-ejb3-10.1.0.Final.jar:10.1.0.Final]

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

          at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:636)

          at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

          at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

          at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:198)

          at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)

          at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

          at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

          at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)

          at fr.docapost.ldap.session.CompanyRepoLocal$$$view20.findByDistinguishedName(Unknown Source) [ldap-facade.jar:]

      .....................

      Caused by: java.lang.NullPointerException

          at org.infinispan.jcache.embedded.JCacheManager.create(JCacheManager.java:147) [infinispan-jcache.jar:8.0.2.Final]

          at org.infinispan.jcache.AbstractJCacheManager.createCache(AbstractJCacheManager.java:94) [infinispan-jcache-commons.jar:8.0.2.Final]

          at org.infinispan.jcache.annotation.DefaultCacheResolver.getOrCreateCache(DefaultCacheResolver.java:46) [infinispan-jcache.jar:8.0.2.Final]

          at org.infinispan.jcache.annotation.DefaultCacheResolver.resolveCache(DefaultCacheResolver.java:38) [infinispan-jcache.jar:8.0.2.Final]

          at org.infinispan.jcache.annotation.DefaultCacheResolver$Proxy$_$$_WeldClientProxy.resolveCache(Unknown Source) [infinispan-jcache.jar:8.0.2.Final]

          at org.infinispan.jcache.annotation.AbstractCacheResultInterceptor.cacheResult(AbstractCacheResultInterceptor.java:56) [infinispan-jcache.jar:8.0.2.Final]

          at org.infinispan.jcache.annotation.CacheResultInterceptor.cacheResult(CacheResultInterceptor.java:47) [infinispan-jcache.jar:8.0.2.Final]

       

      And here are my maven dependencies:

       

      <dependency>
        <groupId>javax.cache</groupId>
        <artifactId>cache-api</artifactId>
      </dependency>
      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-core</artifactId>
      </dependency>
      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-commons</artifactId>
      </dependency>
      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-cdi</artifactId>
      </dependency>
      <dependency>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-jcache</artifactId>
        <exclusions>
          <exclusion>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-core</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-commons</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      The deployed EAR doesn't contain infinispan-core and infinispan-commons but uses the one deployed with wildfly. the MANIFEST.MF reads as follows:

       

      Manifest-Version: 1.0

      Archiver-Version: Plexus Archiver

      Built-By: nduminil

      Class-Path: jasypt-1.9.2.jar spring-ldap-core-2.1.0.RELEASE.jar spring

      -beans-4.2.5.RELEASE.jar spring-core-4.2.5.RELEASE.jar spring-tx-4.2.

      5.RELEASE.jar spring-data-commons-1.12.3.RELEASE.jar jcl-over-slf4j-1

      .7.7.jbossorg-1.jar spring-expression-4.2.5.RELEASE.jar spring-contex

      t-4.2.5.RELEASE.jar spring-ldap-odm-2.1.0.RELEASE.jar commons-cli-1.2

      .jar freemarker-2.3.20.jar spring-ldap-core-tiger-2.1.0.RELEASE.jar s

      pring-aop-4.2.5.RELEASE.jar aopalliance-1.0.jar ldap-data-2.0.0-SNAPS

      HOT.jar javax.mail-1.5.5.jar mail-1.4.jar activation-1.1.1.jar apache

      ds-all-2.0.0-M23.jar cache-api-1.0.0.jar infinispan-commons-8.2.4.Fin

      al.jar infinispan-cdi-8.0.2.Final.jar infinispan-jcache-8.0.2.Final.j

      ar infinispan-jcache-commons-8.0.2.Final.jar commons-logging-1.1.1.ja

      r

      Created-By: Apache Maven 3.3.9

      Build-Jdk: 1.8.0_101

      Dependencies: org.infinispan export

       

      I cannot figure out what is the problem here. Many thanks in advance for any help.

       

      Kind regards,

       

      Nicolas