• Bug
  • Status: Closed
  • 1 Critical
  • Resolution: Fixed
  • kkannaiy
  • Reporter: teck
  • June 09, 2009
  • 0
  • Watchers: 0
  • February 12, 2013
  • June 09, 2009

Description

If one fails to provide a tc-hibernate-cache.xml resource, you’ll see this NPE happening. It doesn’t appear fatal (defaults are used for everything) but I was under the impression this is a valid configuration

Caused by: java.lang.NullPointerException [INFO] [h2lcPerfClient] at java.io.Reader.(Reader.java:61) [INFO] [h2lcPerfClient] at java.io.InputStreamReader.(InputStreamReader.java:55) [INFO] [h2lcPerfClient] at org.terracotta.modules.hibernatecache.config.XMLConfigurationProvider.getXMLConfigStream(XMLConfigurationProvider.java:115) [INFO] [h2lcPerfClient] at org.terracotta.modules.hibernatecache.config.XMLConfigurationProvider.(XMLConfigurationProvider.java:77) [INFO] [h2lcPerfClient] at org.terracotta.modules.hibernatecache.config.XMLConfigurationProvider.(XMLConfigurationProvider.java:73) [INFO] [h2lcPerfClient] at org.terracotta.modules.hibernatecache.provider.BaseTerracottaCacheProvider.getConfigurationProvider(BaseTerracottaCacheProvider.java:127) [INFO] [h2lcPerfClient] at org.terracotta.modules.hibernatecache.provider.BaseTerracottaCacheProvider.start(BaseTerracottaCacheProvider.java:100) [INFO] [h2lcPerfClient] at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.start(RegionFactoryCacheProviderBridge.java:72) [INFO] [h2lcPerfClient] at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:215) [INFO] [h2lcPerfClient] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327) [INFO] [h2lcPerfClient] at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867) [INFO] [h2lcPerfClient] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669) [INFO] [h2lcPerfClient] at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132) [INFO] [h2lcPerfClient] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:227) [INFO] [h2lcPerfClient] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:273) [INFO] [h2lcPerfClient] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1367) [INFO] [h2lcPerfClient] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1333) [INFO] [h2lcPerfClient] ... 54 more

Comments

Chris Dennis 2009-06-09

Now fixed, and test coverage has been added.

Kalai Kannaiyan 2009-07-10

Tested with h2lcperf tc-3.1 branch, NPE is not thrown when tc-hibernate-cache.xml resource does not exist. Closing this issue

Scenario: removed the default tc-hibernate-cache.xml Steps:

  1. checkout https://svn.terracotta.org/repo/forge/projects/h2lcperf/branches/tc-3.1
  2. removed the default tc-hibernate-cache.xml under src/main/resources
  3. mvn clean package
  4. mvn tc:run -Dmaven.test.skip=true

Actual: the test is running fine, NPE is not thrown, but it is not complaining about the file does not exist (Opened DEV-3034)