3 Replies Latest reply on Nov 16, 2014 9:18 AM by Alexandre Nikolov

    LevelDB configuration

    Alexandre Nikolov Newbie

      Hello,

       

      I have build a web application that uses Infinispan 7.0.Final. Initially I was using persistence configuraiton as follows:

              <local-cache name="default">

                  <eviction max-entries="5000"/>

                  <persistence passivation="false" >

                      <file-store shared="false" fetch-state="true" preload="true" purge="false" path="/cache">

                          <write-behind />

                      </file-store>

                  </persistence>

              </local-cache>

      This worked fine. But than I tried to use LevelDB cache store.

      I added to my pom the following dependency:

              <dependency>

                  <groupId>org.infinispan</groupId>

                  <artifactId>infinispan-core</artifactId>

                  <version>7.0.0.Final</version>

              </dependency>

              <dependency>

                  <groupId>org.infinispan</groupId>

                  <artifactId>infinispan-cachestore-leveldb</artifactId>

                  <version>7.0.0.Final</version>

              </dependency>

      And changed the infinispan.xml configuration as follows:

              <local-cache name="default">

                  <eviction max-entries="5000"/>

                  <persistence passivation="false" >

                      <leveldb-store path="/cache/leveldb/data">

                          <expiration path="/cache/leveldb/expired"/>

                          <implementation type="JAVA" />

                      </leveldb-store>

                  </persistence>

              </local-cache>

       

      Now when I try to deploy my application on Glassfish 3.2.2 I am getting the following exception:

       

      WARNING: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.infinispan.commons.CacheConfigurationException: ISPN000327: Cannot find a parser for element 'leveldb-store' in namespace 'urn:infinispan:config:7.0'. Check that your configuration is up-to date for this version of Infinispan.

      java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.infinispan.commons.CacheConfigurationException: ISPN000327: Cannot find a parser for element 'leveldb-store' in namespace 'urn:infinispan:config:7.0'. Check that your configuration is up-to date for this version of Infinispan.

        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:921)

        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)

        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)

        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)

        at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)

        at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)

        at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)

        at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)

        at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)

        at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)

        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:389)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1085)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1291)

        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1259)

        at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)

        at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)

        at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)

        at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)

        at com.sun.enterprise.v3.services.impl.ContainerMapper$Hk2DispatcherCallable.call(ContainerMapper.java:354)

        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)

        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:850)

        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:747)

        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1036)

        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:231)

        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)

        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)

        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)

        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)

        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)

        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)

        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)

        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)

        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)

        at java.lang.Thread.run(Thread.java:744)

       

       

      For some reason it cannot parse the LevelDB related configuration.

      If I create the same configuration programmaticaly, it works fine, but I prefer the configuration to be declarative in external file.

       

      What am I doing wrong ?

        • 1. Re: LevelDB configuration
          Wolf-Dieter Fink Master

          Could you show the structure of you jar and attach the configuration file?

          • 2. Re: LevelDB configuration
            Radim Vansa Master

            You have to specify XML namespace for LevelDB, as LevelDB is not a part of the core schema. Always use schemas for configuration validation (most IDEs can do that).

             

            <local-cache name="local_leveldb">

                      <eviction max-entries="10000" />

                      <persistence>

                         <leveldb-store xmlns="urn:infinispan:config:store:leveldb:7.0"

                                  purge="true"

                                  path="/home_local/tmp/leveldb/data">

                            <expiration path="/home_local/tmp/leveldb/expiration" />

                            <implementation type="JNI" />

                         </leveldb-store>

                      </persistence>

                   </local-cache>

            • 3. Re: LevelDB configuration
              Alexandre Nikolov Newbie

              Thank you.

              Specifying the XML name space resolved the issue.

              This detail is missing from the documentation and the example configuration in the User Guide is without the name space. Probably this needs updating because it creates confusion.

               

              Regards,

              Aleksandar Nikolov