8 Replies Latest reply on Aug 20, 2009 6:30 PM by kevin41

    CacheException getCache

      Using the tutorial have tried the following code using ALPHA6 and I am getting this error, any help would be appreciated.

      GlobalConfiguration gc = new GlobalConfiguration();
      gc.setTransportClass(JGroupsTransport.class.getName());
      CacheManager cm = new DefaultCacheManager(gc);
      Cache cache = cm.getCache(name);
      // I have also tryed the following code with the same error.
      CacheManager cm = new DefaultCacheManager( GlobalConfiguration.getClusteredDefault());
      Cache cache = cm.getCache(name);


      Exception:
      log4j:WARN No appenders could be found for logger (org.infinispan.factories.GlobalComponentRegistry).
      log4j:WARN Please initialize the log4j system properly.
      Exception in thread "main" org.infinispan.CacheException: Unable to invoke method public abstract void org.infinispan.remoting.transport.Transport.start() on object
      at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:137)
      at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:851)
      at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:694)
      at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:584)
      at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:134)
      at org.infinispan.CacheDelegate.start(CacheDelegate.java:252)
      at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:342)
      at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:306)

        • 1. Re: CacheException getCache
          galder.zamarreno

          Would it be possible for you to logging? When that exception is reported, there's a root exception also thrown but it does not appear in your message. That will explain the root cause.

          • 2. Re: CacheException getCache
            manik
            • 3. Re: CacheException getCache

              Attached is the logging output.

              log4j: Adding appender named [CONSOLE] to category [root].
              2009-08-20 09:38:51,218 INFO [JGroupsTransport] (main) Starting JGroups Channel
              2009-08-20 09:38:51,219 INFO [JGroupsTransport] (main) Unable to use any JGroups configuration mechanisms provided in properties {}. Using default JGroups configuration!
              2009-08-20 09:38:51,641 WARN [UDP] (main) failed to join /224.0.75.75:7500 on net4: java.net.SocketException: Unrecognized Windows Sockets error: 0: no Inet4Address associated with interface
              2009-08-20 09:38:51,641 WARN [UDP] (main) failed to join /224.0.75.75:7500 on eth7: java.net.SocketException: Unrecognized Windows Sockets error: 0: no Inet4Address associated with interface
              2009-08-20 09:38:51,642 WARN [UDP] (main) failed to join /224.0.75.75:7500 on net14: java.net.SocketException: Unrecognized Windows Sockets error: 0: no Inet4Address associated with interface
              2009-08-20 09:38:51,642 WARN [UDP] (main) failed to join /224.0.75.75:7500 on net15: java.net.SocketException: Unrecognized Windows Sockets error: 0: no Inet4Address associated with interface
              2009-08-20 09:38:51,643 WARN [UDP] (main) failed to join /224.0.75.75:7500 on net16: java.net.SocketException: Unrecognized Windows Sockets error: 0: no Inet4Address associated with interface

              ---------------------------------------------------------
              GMS: address is 192.168.1.103:57275 (cluster=Infinispan-Cluster)
              ---------------------------------------------------------
              2009-08-20 09:38:53,659 INFO [JGroupsTransport] (main) Received new cluster view: [192.168.1.103:57275|0] [192.168.1.103:57275]
              2009-08-20 09:38:58,660 WARN [JChannel] (main) 192.168.1.103:57275 waiting on UNBLOCK after connect() timed out
              org.infinispan.CacheException: Unable to invoke method public abstract void org.infinispan.remoting.transport.Transport.start() on object
              at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:137)
              at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:851)
              at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:694)
              at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:584)
              at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:134)
              at org.infinispan.CacheDelegate.start(CacheDelegate.java:252)
              at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:342)
              at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:306)
              at net.carefx.cache.impl.infinispan.CfxInifinispan.(CfxInifinispan.java:75)
              at net.carefx.cache.CacheFactory.getInstance(CacheFactory.java:72)
              at net.carefx.cache.impl.infinispan.CfxInifinispan.main(CfxInifinispan.java:189)
              Caused by: java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:134)
              ... 10 more
              Caused by: java.lang.NoSuchMethodError: org.jgroups.Channel.getAddress()Lorg/jgroups/Address;
              at org.infinispan.remoting.transport.jgroups.JGroupsTransport.getAddress(JGroupsTransport.java:276)
              at org.infinispan.remoting.transport.jgroups.JGroupsTransport.start(JGroupsTransport.java:107)
              ... 15 more

              • 4. Re: CacheException getCache
                manik

                What version of JGroups are you using? You need 2.8.x for Infinispan to work.

                • 5. Re: CacheException getCache

                  I am using the version that was delivered in the Infinispan distribution. The jar file in lib folder is "jgroups-2.8.0.Beta1.jar". Also, I noticed that the link on the site for alpha6 actually downloads alpha5?

                  • 6. Re: CacheException getCache

                    I was able to find and install ALPHA6, it uses "jgroups-2.8.0.Beta2.jar". I also disabled IPV6 and that removed a couple of the errors in the previous logs. However, I am still getting the following exception.


                    log4j: Adding appender named [CONSOLE] to category [root].
                    2009-08-20 13:32:08,377 INFO [JGroupsTransport] (main) Starting JGroups Channel
                    2009-08-20 13:32:08,377 INFO [JGroupsTransport] (main) Unable to use any JGroups configuration mechanisms provided in properties {}. Using default JGroups configuration!

                    ---------------------------------------------------------
                    GMS: address is 192.168.1.103:56228 (cluster=Infinispan-Cluster)
                    ---------------------------------------------------------
                    2009-08-20 13:32:11,322 INFO [JGroupsTransport] (main) Received new cluster view: [192.168.1.103:56228|0] [192.168.1.103:56228]
                    2009-08-20 13:32:16,324 WARN [JChannel] (main) 192.168.1.103:56228 waiting on UNBLOCK after connect() timed out
                    org.infinispan.CacheException: Unable to invoke method public abstract void org.infinispan.remoting.transport.Transport.start() on object
                    at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:137)
                    at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:861)
                    at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:704)
                    at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:594)
                    at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:134)
                    at org.infinispan.CacheDelegate.start(CacheDelegate.java:252)
                    at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:342)
                    at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:306)
                    at net.carefx.cache.impl.infinispan.CfxInifinispan.(CfxInifinispan.java:75)
                    at net.carefx.cache.CacheFactory.getInstance(CacheFactory.java:72)
                    at net.carefx.cache.impl.infinispan.CfxInifinispan.main(CfxInifinispan.java:189)
                    Caused by: java.lang.reflect.InvocationTargetException
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                    at java.lang.reflect.Method.invoke(Unknown Source)
                    at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:134)
                    ... 10 more
                    Caused by: java.lang.NoSuchMethodError: org.jgroups.Channel.getAddress()Lorg/jgroups/Address;
                    at org.infinispan.remoting.transport.jgroups.JGroupsTransport.getAddress(JGroupsTransport.java:276)
                    at org.infinispan.remoting.transport.jgroups.JGroupsTransport.start(JGroupsTransport.java:107)
                    ... 15 more

                    • 7. Re: CacheException getCache
                      manik

                      Hmm, getAddress() was specifically added in JGroups 2.8. Can you please make sure there is no stale version of JGroups on your classpath? java -version jgroups.jar will tell you its version.

                      • 8. Re: CacheException getCache

                        Yes, that was problem. It must have been picking up another jgroups jar. Thank you for your help.