5 Replies Latest reply on Nov 17, 2015 8:42 PM by gxin2015

    How to use ispn-cli to with embedded ISPN cache manager?

    dex80526

      I tried to use the ispn-cli to access my embedded ISPN instance. The cli always returns "The remote server does not expose any CacheManagers".

       

      I have the following configuration in infinispan.xml:

      <global> 

            <globalJmxStatistics enabled="true" />

        ....

        </global>

       

      and for the caches

      <jmxStatistics enabled="true"/>

       

      When I connect to it using JConsole, I do see the CacheManager and Cache under MBeans.

       

      What did I miss here?

       

      Thanks,

       

      dex

        • 1. Re: How to use ispn-cli to with embedded ISPN cache manager?
          nadirx

          You need to include the infinispan-cli-server jar in your deployment as described in the second paragraph here:

           

          https://docs.jboss.org/author/display/ISPN/Command-Line+Interface+%28CLI%29

          • 2. Re: How to use ispn-cli to with embedded ISPN cache manager?
            dex80526

            Tristan: thanks for the quick response. Yes, it works when I included the cli-server jar.

            • 3. Re: How to use ispn-cli to with embedded ISPN cache manager?
              gxin2015

              hi Tristan

              my infinispan version is 7.2.5,in this version ,it does not have infinispan-cli-server.jar,it has infinispan-cli-7.2.5.Final.jar,and i include this jar in my deployment ,but ,it does not work,why?thx.

              • 4. Re: How to use ispn-cli to with embedded ISPN cache manager?
                nadirx

                It was renamed to infinispan-cli-interpreter in Infinispan 7.

                • 5. Re: How to use ispn-cli to with embedded ISPN cache manager?
                  gxin2015

                  Tristan:thanks for you response,i find the jar of infinispan-cli-interpreter,and include to my deployment,but when run my program,raise error

                  Exception in thread "main" java.util.ServiceConfigurationError: org.infinispan.lifecycle.ModuleLifecycle: Provider org.infinispan.cli.interpreter.LifecycleCallbacks could not be instantiated

                    at java.util.ServiceLoader.fail(ServiceLoader.java:224)

                    at java.util.ServiceLoader.access$100(ServiceLoader.java:181)

                    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:377)

                    at java.util.ServiceLoader$1.next(ServiceLoader.java:445)

                    at org.infinispan.commons.util.ServiceFinder.addServices(ServiceFinder.java:60)

                    at org.infinispan.commons.util.ServiceFinder.load(ServiceFinder.java:42)

                    at org.infinispan.util.ModuleProperties.resolveModuleLifecycles(ModuleProperties.java:41)

                    at org.infinispan.factories.GlobalComponentRegistry.<init>(GlobalComponentRegistry.java:97)

                    at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:292)

                    at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:271)

                    at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:244)

                    at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:231)

                    at main.java.embeddedcache.Quickstart.createCacheManagerFromXml(Quickstart.java:267)

                    at main.java.embeddedcache.Quickstart.<clinit>(Quickstart.java:40)

                  Caused by: java.lang.ExceptionInInitializerError

                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

                    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

                    at java.lang.Class.newInstance(Class.java:379)

                    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373)

                    ... 11 more

                  Caused by: java.lang.IllegalArgumentException: Logger implementation class org.infinispan.cli.interpreter.logging.Log_$logger has no matching constructor

                    at infinispan.org.jboss.logging.Logger$1.run(Logger.java:2260)

                    at java.security.AccessController.doPrivileged(Native Method)

                    at infinispan.org.jboss.logging.Logger.getMessageLogger(Logger.java:2227)

                    at infinispan.org.jboss.logging.Logger.getMessageLogger(Logger.java:2214)

                    at org.infinispan.util.logging.LogFactory.getLog(LogFactory.java:21)

                    at org.infinispan.cli.interpreter.LifecycleCallbacks.<clinit>(LifecycleCallbacks.java:20)

                    ... 17 more

                   

                  my code:

                  EmbeddedCacheManager manager = null;
                  try {
                  manager = new DefaultCacheManager("infinispan.xml");
                  } catch (IOException e) {
                  e.printStackTrace();
                  }

                   

                  and my configurationfile

                    

                  <jgroups>

                        <stack-file name="tcp" path="jgroups-tcp.xml"/>

                      </jgroups>

                    

                       <cache-container name="test" statistics="true"  default-cache="repl-cache" shutdown-hook="DEFAULT">

                     

                        <transport stack="tcp" cluster="infinispan-cluster" node-name="Node-A" machine="m1" rack="r1" site="LON" />

                   

                   

                         <jmx domain="org.infinispan" />

                         <distributed-cache name="dist-cache" mode="SYNC" l1-lifespan="60000" owners="2" statistics="true"/>

                         <replicated-cache name="repl-cache" statistics="true" mode="SYNC" remote-timeout="20000"/>

                     </cache-container>

                  • 6. Re: How to use ispn-cli to with embedded ISPN cache manager?
                    gxin2015

                    hi Tristan

                    i have fond the reason for the error above,i used the infinispan-embedded-7.2.5.Final.jar,when i repalce it to infinispan-core-7.2.5.Final.jar,the problem solved,what the different between infinispan-embedded-7.2.5.Final.jar and infinispan-core-7.2.5.Final.jar?