org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateSessionFactory' defined in class path resource [sysconf/applicationContext-jbpm-sessionFactory.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: java.lang.AssertionError: NaN Eviction Cost [hit:NaN miss:NaN size:0]

Terracotta Project Issue Tracker | Davide Cavestro | 4 years ago
  1. 0

    At JUnit unit tests execution time a Spring application context is initialized for each test during set up and destroyed during tear down. The application context takes care of creating an Hibernate SessionFactory which is configured to use a _net.sf.ehcache.hibernate.EhCacheProvider_ cache provider. Sometimes (not always!) unit tests fail with the following exception: {code} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateSessionFactory' defined in class path resource [sysconf/applicationContext-jbpm-sessionFactory.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: java.lang.AssertionError: NaN Eviction Cost [hit:NaN miss:NaN size:0] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:119) at com.cardinis.cardinis.test.CardinisTestCaseHelper.init(CardinisTestCaseHelper.java:233) at com.cardinis.cardinis.test.CardinisTestSuite.setUpEnvironment(CardinisTestSuite.java:189) at sun.reflect.GeneratedMethodAccessor296.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) [...] Caused by: net.sf.ehcache.CacheException: java.lang.AssertionError: NaN Eviction Cost [hit:NaN miss:NaN size:0] at net.sf.ehcache.CacheManager.init(CacheManager.java:367) at net.sf.ehcache.CacheManager.<init>(CacheManager.java:243) at net.sf.ehcache.hibernate.EhCacheProvider.start(EhCacheProvider.java:101) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:183) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417) ... 61 more Caused by: java.lang.AssertionError: NaN Eviction Cost [hit:NaN miss:NaN size:0] at net.sf.ehcache.pool.impl.AbstractBalancedAccessEvictor.evictionCost(AbstractBalancedAccessEvictor.java:172) at net.sf.ehcache.pool.impl.AbstractBalancedAccessEvictor.access$000(AbstractBalancedAccessEvictor.java:37) at net.sf.ehcache.pool.impl.AbstractBalancedAccessEvictor$EvictionCostComparator.compare(AbstractBalancedAccessEvictor.java:63) at java.util.Arrays.mergeSort(Arrays.java:1270) at java.util.Arrays.sort(Arrays.java:1210) at java.util.Collections.sort(Collections.java:159) at net.sf.ehcache.pool.impl.AbstractBalancedAccessEvictor.freeSpace(AbstractBalancedAccessEvictor.java:124) at net.sf.ehcache.pool.impl.AbstractPool.setMaxSize(AbstractPool.java:87) at net.sf.ehcache.config.CacheConfiguration.updateCacheManagerPoolSizes(CacheConfiguration.java:1656) at net.sf.ehcache.config.CacheConfiguration.setupFor(CacheConfiguration.java:1545) at net.sf.ehcache.CacheManager.initializeEhcache(CacheManager.java:1234) at net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1289) at net.sf.ehcache.CacheManager.addConfiguredCaches(CacheManager.java:706) at net.sf.ehcache.CacheManager.doInit(CacheManager.java:424) at net.sf.ehcache.CacheManager.init(CacheManager.java:358) ... 70 more {code} This issue originated from http://forums.terracotta.org/forums/posts/list/8010.page

    Terracotta Project Issue Tracker | 4 years ago | Davide Cavestro
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateSessionFactory' defined in class path resource [sysconf/applicationContext-jbpm-sessionFactory.xml]: Invocation of init method failed; nested exception is net.sf.ehcache.CacheException: java.lang.AssertionError: NaN Eviction Cost [hit:NaN miss:NaN size:0]
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    [TEST-FAILURE] EvictionMaxSizePolicyTest.testFreeHeapPercentagePolicy

    GitHub | 2 years ago | eminn
    java.lang.AssertionError: map size is 1000, heap cost is 1125899906842624000 in bytes but total memory is 749207552 in bytes
  4. 0

    happens with one of the random cases in http://test.0xdata.com/job/h2o.nightly/837/testReport/junit/test_GLM2_tweedie_rand2/Basic/test_GLM2_tweedie_rand2/ cd testdir_single_jvm python test_GLM2_tweedie_rand2.py probably will fail if make a single test with these params just using covtype.data 2/GLM2 parameters: {'family': 'tweedie', 'cols': None, 'n_folds': None, 'use_all_factor_levels': None, 'higher_accuracy': None, 'ignored_cols_by_name': None, 'source': u'covtype.hex', 'lambda_search': None, 'destination_key': None, 'standardize': 0, 'beta_eps': None, 'max_iter': None, 'lambda_min_ratio': None, 'alpha': 0.2, 'response': 54, 'beta_epsilon': None, 'nlambdas': None, 'tweedie_variance_power': 1.9999999, 'ignored_cols': None, 'prior': None, 'parallelism': None, 'strong_rules_enabled': None, 'lambda': 0.0001} { "Request2": 0, "_beta": null, "_proximalPenalty": 0.0, "_runAllLambdas": "true", "_wgiven": null, "alpha": [ 0.2 ], "beta_epsilon": 0.0001, "description": "GLM2", "destination_key": "GLMModel__94ce7d98e9fcad5463a8b66959b945d8", "end_time": 0, "exception": null, "family": "tweedie", "job_key": "GLM2Job__aa13929f6a9bd9be7b79c0933e9141f3", "lambda": [ 0.0001 ], "lambda_max": "NaN", "link": "tweedie", "max_iter": 100, "n_folds": 0, "response": {}, "response_info": { "h2o": "pytest-jenkins-25944", "node": "/10.137.71.117:54321", "redirect_url": "/2/GLMProgress.json?job_key=GLM2Job__aa13929f6a9bd9be7b79c0933e9141f3&destination_key=GLMModel__94ce7d98e9fcad5463a8b66959b945d8", "status": "redirect", "time": 36 }, "source": { "_key": "covtype.hex" }, "standardize": "false", "start_time": 1403690504671, "state": "RUNNING", "tweedie_link_power": -0.9999998999999999, "tweedie_variance_power": 1.9999999, "variable_importances": "true" } at top of poll_url, timeoutSec: 180 redirect http://10.137.71.117:54321/2/GLMProgress.json?job_key=GLM2Job__aa13929f6a9bd9be7b79c0933e9141f3&destination_key=GLMModel__94ce7d98e9fcad5463a8b66959b945d8 rjson: { "error": "Got exception 'class java.lang.AssertionError', with msg 'invalid weight NaN'\njava.lang.AssertionError: invalid weight NaN\n\tat hex.glm.GLMTask$GLMIterationTask.processRow(GLMTask.java:279)\n\tat hex.FrameTask.map(FrameTask.java:581)\n\tat water.MRTask2.compute2(MRTask2.java:404)\n\tat water.MRTask2.compute2(MRTask2.java:358)\n\tat water.MRTask2.compute2(MRTask2.java:358)\n\tat water.H2O$H2OCountedCompleter.compute(H2O.java:711)\n\tat jsr166y.CountedCompleter.exec(CountedCompleter.java:429)\n\tat jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)\n\tat jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)\n\tat jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)\n\tat jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)\n", "response": { "h2o": "pytest-jenkins-25944", "node": "/10.137.71.117:54321", "status": "error", "time": 0 } } rjson error in poll_url: Got exception 'class java.lang.AssertionError', with msg 'invalid weight NaN' java.lang.AssertionError: invalid weight NaN at hex.glm.GLMTask$GLMIterationTask.processRow(GLMTask.java:279) at hex.FrameTask.map(FrameTask.java:581) at water.MRTask2.compute2(MRTask2.java:404) at water.MRTask2.compute2(MRTask2.java:358) at water.MRTask2.compute2(MRTask2.java:358) at water.H2O$H2OCountedCompleter.compute(H2O.java:711) at jsr166y.CountedCompleter.exec(CountedCompleter.java:429) at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) java.lang.AssertionError: invalid weight NaN 03:01:46.163 FJ-0-7 INFO WATER: at hex.glm.GLMTask$GLMIterationTask.processRow(GLMTask.java:279) 03:01:46.164 FJ-0-7 INFO WATER: at hex.FrameTask.map(FrameTask.java:581) 03:01:46.165 FJ-0-7 INFO WATER: at water.MRTask2.compute2(MRTask2.java:404) 03:01:46.167 FJ-0-7 INFO WATER: at water.MRTask2.compute2(MRTask2.java:358) 03:01:46.168 FJ-0-7 INFO WATER: at water.MRTask2.compute2(MRTask2.java:358) 03:01:46.168 FJ-0-7 INFO WATER: at water.H2O$H2OCountedCompleter.compute(H2O.java:711) 03:01:46.169 FJ-0-7 INFO WATER: at jsr166y.CountedCompleter.exec(CountedCompleter.java:429) 03:01:46.169 FJ-0-7 INFO WATER: at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) 03:01:46.171 FJ-0-7 INFO WATER: at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) 03:01:46.171 FJ-0-7 INFO WATER: at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) 03:01:46.172 FJ-0-7 INFO WATER: at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) 03:01:46.173 FJ-0-7 ERRR WATER: Job GLM2Job__aa13929f6a9bd9be7b79c0933e9141f3(GLM2) failed. 03:01:46.173 FJ-0-7 ERRR WATER: Got exception 'class java.lang.AssertionError', with msg 'invalid weight NaN' + java.lang.AssertionError: invalid weight NaN + at hex.glm.GLMTask$GLMIterationTask.processRow(GLMTask.java:279) + at hex.FrameTask.map(FrameTask.java:581) + at water.MRTask2.compute2(MRTask2.java:404) + at water.MRTask2.compute2(MRTask2.java:358) + at water.MRTask2.compute2(MRTask2.java:358) + at water.H2O$H2OCountedCompleter.compute(H2O.java:711) + at jsr166y.CountedCompleter.exec(CountedCompleter.java:429) + at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) + at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) + at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) + at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)

    JIRA | 2 years ago | Kevin Normoyle
    java.lang.AssertionError: invalid weight NaN

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.AssertionError

      NaN Eviction Cost [hit:NaN miss:NaN size:0]

      at net.sf.ehcache.pool.impl.AbstractBalancedAccessEvictor.evictionCost()
    2. Ehcache
      AbstractBalancedAccessEvictor$EvictionCostComparator.compare
      1. net.sf.ehcache.pool.impl.AbstractBalancedAccessEvictor.evictionCost(AbstractBalancedAccessEvictor.java:172)
      2. net.sf.ehcache.pool.impl.AbstractBalancedAccessEvictor.access$000(AbstractBalancedAccessEvictor.java:37)
      3. net.sf.ehcache.pool.impl.AbstractBalancedAccessEvictor$EvictionCostComparator.compare(AbstractBalancedAccessEvictor.java:63)
      3 frames
    3. Java RT
      Collections.sort
      1. java.util.Arrays.mergeSort(Arrays.java:1270)
      2. java.util.Arrays.sort(Arrays.java:1210)
      3. java.util.Collections.sort(Collections.java:159)
      3 frames
    4. Ehcache
      EhCacheProvider.start
      1. net.sf.ehcache.pool.impl.AbstractBalancedAccessEvictor.freeSpace(AbstractBalancedAccessEvictor.java:124)
      2. net.sf.ehcache.pool.impl.AbstractPool.setMaxSize(AbstractPool.java:87)
      3. net.sf.ehcache.config.CacheConfiguration.updateCacheManagerPoolSizes(CacheConfiguration.java:1656)
      4. net.sf.ehcache.config.CacheConfiguration.setupFor(CacheConfiguration.java:1545)
      5. net.sf.ehcache.CacheManager.initializeEhcache(CacheManager.java:1234)
      6. net.sf.ehcache.CacheManager.addCacheNoCheck(CacheManager.java:1289)
      7. net.sf.ehcache.CacheManager.addConfiguredCaches(CacheManager.java:706)
      8. net.sf.ehcache.CacheManager.doInit(CacheManager.java:424)
      9. net.sf.ehcache.CacheManager.init(CacheManager.java:358)
      10. net.sf.ehcache.CacheManager.init(CacheManager.java:367)
      11. net.sf.ehcache.CacheManager.<init>(CacheManager.java:243)
      12. net.sf.ehcache.hibernate.EhCacheProvider.start(EhCacheProvider.java:101)
      12 frames
    5. Hibernate
      SessionFactoryImpl.<init>
      1. org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:183)
      1 frame
    6. Hibernate
      Configuration.buildSessionFactory
      1. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
      1 frame
    7. Hibernate
      AbstractSessionFactoryBean.afterPropertiesSet
      1. org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
      2. org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
      3. org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
      3 frames
    8. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
      5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      6. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
      7. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      8. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
      9. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
      10. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
      10 frames
    9. Spring Context
      ClassPathXmlApplicationContext.<init>
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
      3. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
      4. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:119)
      4 frames
    10. com.cardinis.cardinis
      CardinisTestSuite.setUpEnvironment
      1. com.cardinis.cardinis.test.CardinisTestCaseHelper.init(CardinisTestCaseHelper.java:233)
      2. com.cardinis.cardinis.test.CardinisTestSuite.setUpEnvironment(CardinisTestSuite.java:189)
      2 frames
    11. Java RT
      Method.invoke
      1. sun.reflect.GeneratedMethodAccessor296.invoke(Unknown Source)
      2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3. java.lang.reflect.Method.invoke(Method.java:597)
      3 frames
    12. JUnit
      JUnit4ClassRunner.run
      1. org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122)
      2. org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
      3. org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
      4. org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
      5. org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
      6. org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
      7. org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
      8. org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
      9. org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
      10. org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)[...]
      10 frames