Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-422

Configuration.setConsistentHashClass not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.1.0.BETA1
    • 4.0.0.Final, 4.1.0.ALPHA3
    • Configuration, Core
    • None

      Consistent class cannot be defined via configuration. Doing so throws:

      org.infinispan.CacheException: Could not apply value for field class from instance org.infinispan.config.Configuration$HashType@f449758d on instance org.infinispan.config.OverrideConfigurationVisitor@182a033
      at org.infinispan.config.OverrideConfigurationVisitor.overrideFields(OverrideConfigurationVisitor.java:97)
      at org.infinispan.config.OverrideConfigurationVisitor.override(OverrideConfigurationVisitor.java:80)
      at org.infinispan.config.Configuration.applyOverrides(Configuration.java:156)
      at org.infinispan.manager.DefaultCacheManager.defineConfiguration(DefaultCacheManager.java:372)
      at org.infinispan.manager.DefaultCacheManager.defineConfiguration(DefaultCacheManager.java:342)
      at org.infinispan.test.MultipleCacheManagersTest.createClusteredCaches(MultipleCacheManagersTest.java:139)
      at org.infinispan.distribution.BaseDistFunctionalTest.createCacheManagers(BaseDistFunctionalTest.java:59)
      at org.infinispan.test.MultipleCacheManagersTest.callCreateCacheManagers(MultipleCacheManagersTest.java:56)
      at org.infinispan.test.MultipleCacheManagersTest.createBeforeClass(MultipleCacheManagersTest.java:51)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:644)
      at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:443)
      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:160)
      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:90)
      at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:183)
      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:115)
      at org.testng.TestRunner.runWorkers(TestRunner.java:908)
      at org.testng.TestRunner.privateRun(TestRunner.java:617)
      at org.testng.TestRunner.run(TestRunner.java:498)
      at org.testng.SuiteRunner.runTest(SuiteRunner.java:329)
      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:324)
      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:296)
      at org.testng.SuiteRunner.run(SuiteRunner.java:201)
      at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:915)
      at org.testng.TestNG.runSuitesLocally(TestNG.java:879)
      at org.testng.TestNG.run(TestNG.java:787)
      at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:75)
      at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:79)
      Caused by: org.infinispan.CacheException: Could not find field named: class on instance :org.infinispan.config.Configuration$HashType@f449758d
      at org.infinispan.util.ReflectionUtil.getValue(ReflectionUtil.java:204)
      at org.infinispan.config.OverrideConfigurationVisitor.overrideFields(OverrideConfigurationVisitor.java:95)
      ... 30 more

      This is because the field name provided to testImmutability call in setConsistentHashClass is "class". Hence, it tries to override a field called "class" which does not exist. Making the field "consistentHashClass" fixes the issue.

              rh-ee-galder Galder ZamarreƱo
              rh-ee-galder Galder ZamarreƱo
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: