5 Replies Latest reply on Jul 26, 2006 1:10 AM by Maarten Roosendaal

    hot-redeployment fails because of CacheException: null

    Maarten Roosendaal Newbie

      Hi,

      I have an ear-application which contains 1 war and 1 ejb -file and, serveral jar-files in the lib-directory. As a configuration i also turned off the tomcat-classloader for war-file to be able to use 1 shared Spring-context and it works. When i first deploy the application it works fine, when i redeploy the application it get the following error:

      ****************************************
      building session factory
      2006-01-16 11:13:12,326 DEBUG [org.hibernate.impl.SessionFactoryImpl] Session factory constructed with filter configurations : {}
      2006-01-16 11:13:12,326 DEBUG [org.hibernate.impl.SessionFactoryImpl] instantiating session factory with properties: {java.vendor=Sun Microsystems Inc., catalina.base=C:\jboss-4.0.2\server\spg_node1, catalina.useNaming=false, os.name=Windows 2003, sun.boot.class.path=C:\jboss-4.0.2\bin\\..\lib\endorsed\resolver.jar;C:\jboss-4.0.2\bin\\..\lib\endorsed\xalan.jar;C:\jboss-4.0.2\bin\\..\lib\endorsed\xercesImpl.jar;C:\jboss-4.0.2\bin\\..\lib\endorsed\xml-apis.jar;C:\j2sdk1.4.2_08\jre\lib\rt.jar;C:\j2sdk1.4.2_08\jre\lib\i18n.jar;C:\j2sdk1.4.2_08\jre\lib\sunrsasign.jar;C:\j2sdk1.4.2_08\jre\lib\jsse.jar;C:\j2sdk1.4.2_08\jre\lib\jce.jar;C:\j2sdk1.4.2_08\jre\lib\charsets.jar;C:\j2sdk1.4.2_08\jre\classes, sun.java2d.fontpath=, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.4.2_08-b03, hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider, user.name=mroosendaal, shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar, jboss.bind.address=0.0.0.0, tomcat.util.buf.StringCache.byte.enabled=true, jboss.home.dir=C:\jboss-4.0.2, user.language=nl, java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, sun.boot.library.path=C:\j2sdk1.4.2_08\jre\bin, jboss.home.url=file:/C:/jboss-4.0.2/, jacorb.config.log.verbosity=0, java.version=1.4.2_08, user.timezone=Europe/Berlin, jboss.server.home.dir=C:\jboss-4.0.2\server\spg_node1, sun.arch.data.model=32, javax.rmi.CORBA.UtilClass=org.jboss.iiop.SunJDK14IsLocalBugFix, java.endorsed.dirs=C:\jboss-4.0.2\bin\\..\lib\endorsed, jboss.server.home.url=file:/C:/jboss-4.0.2/server/spg_node1/, sun.cpu.isalist=pentium i486 i386, file.encoding.pkg=sun.io, package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans., file.separator=\, java.specification.name=Java Platform API Specification, hibernate.cglib.use_reflection_optimizer=true, java.class.version=48.0, jboss.server.config.url=file:/C:/jboss-4.0.2/server/spg_node1/conf/, user.country=NL, java.home=C:\j2sdk1.4.2_08\jre, java.vm.info=mixed mode, jboss.lib.url=file:/C:/jboss-4.0.2/lib/, os.version=5.2, org.omg.CORBA.ORBSingletonClass=org.jboss.system.ORBSingleton, path.separator=;, java.vm.version=1.4.2_08-b03, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, hibernate.sql=false, user.variant=, java.protocol.handler.pkgs=org.jboss.net.protocol, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper., jboss.server.temp.dir=C:\jboss-4.0.2\server\spg_node1\tmp, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces, user.home=C:\Documents and Settings\mroosendaal, java.rmi.server.RMIClassLoaderSpi=org.jboss.system.JBossRMIClassLoader, java.specification.vendor=Sun Microsystems Inc., java.library.path=C:\j2sdk1.4.2_08\bin;.;C:\WINDOWS\system32;C:\Documents and Settings\mroosendaal\WINDOWS;C:\j2sdk1.4.2_08\bin;C:\j2sdk1.4.2_08\jre\bin;C:\oracle\ora92\bin;C:\Program Files\Rational\common;C:\Program Files\Rational\ClearCase\bin;C:\Program Files\Windows Resource Kits\Tools\;C:\Program Files\Support Tools\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\HP OpenView\Installed Packages\{790c06b4-844e-11d2-972b-080009ef8c2a}\bin;C:\Program Files\HP OpenView\Installed Packages\{790c06b4-844e-11d2-972b-080009ef8c2a}\bin\OpC;C:\UnxUtils;C:\apache-ant-1.6.5\bin;C:\apache-ant-1.6.5\bin, java.vendor.url=http://java.sun.com/, program.name=run.bat, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect, common.loader=${catalina.home}/common/classes,${catalina.home}/common/i18n/*.jar,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, java.class.path=C:\j2sdk1.4.2_08\lib\tools.jar;C:\jboss-4.0.2\bin\\run.jar, jbossmx.loader.repository.class=org.jboss.mx.loading.UnifiedLoaderRepository3, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, catalina.home=C:\jboss-4.0.2\server\spg_node1, sun.cpu.endian=little, sun.os.patch.level=, jboss.server.lib.url=file:/C:/jboss-4.0.2/server/spg_node1/lib/, hibernate.connection.provider_class=org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider, java.rmi.server.codebase=http://src-r-ts04:8383/, java.io.tmpdir=C:\DOCUME~1\MROOSE~1\LOCALS~1\Temp\5\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar, jboss.server.data.dir=C:\jboss-4.0.2\server\spg_node1\data, os.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=C:\j2sdk1.4.2_08\jre\lib\ext, user.dir=C:\jboss-4.0.2\bin, line.separator=
      , java.vm.name=Java HotSpot(TM) Client VM, jboss.server.base.dir=C:\jboss-4.0.2\server, org.jboss.ORBSingletonDelegate=org.jacorb.orb.ORBSingleton, jboss.server.base.url=file:/C:/jboss-4.0.2/server/, javax.management.builder.initial=org.jboss.mx.server.MBeanServerBuilderImpl, org.omg.CORBA.ORBClass=org.jacorb.orb.ORB, file.encoding=Cp1252, catalina.ext.dirs=C:\jboss-4.0.2\server\spg_node1\lib, java.specification.version=1.4, jboss.server.name=spg_node1, hibernate.show_sql=false}
      2006-01-16 11:13:12,326 DEBUG [net.sf.ehcache.CacheManager] Creating new CacheManager with default config
      2006-01-16 11:13:12,326 DEBUG [net.sf.ehcache.CacheManager] Configuring ehcache from classpath.
      2006-01-16 11:13:12,326 WARN [net.sf.ehcache.config.Configurator] No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: null
      2006-01-16 11:13:12,342 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [SystemProperties,transactionManager,abstractTxDefinition,BaseTableDAOTarget,BaseTableDAO,LO3PLDAOTarget,LO3PLDAO,WorkflowDAOTarget,WorkflowDAO,dao,pldao,LO3BerichtDAOTarget,LO3BerichtDAO,USI,protocolleringService,dataSource,sessionFactory,beheerApplicatieService,messagesender,jmsTemplate,jmsConnectionFactory]; root of BeanFactory hierarchy}
      2006-01-16 11:13:12,342 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in URL [file:/usr/local/spg/config/coreContext.xml]: Can't resolve reference to bean 'sessionFactory' while setting property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/jbossContext.xml]: Initialization of bean failed; nested exception is org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Cannot configure CacheManager: null
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/jbossContext.xml]: Initialization of bean failed; nested exception is org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Cannot configure CacheManager: null
      org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Cannot configure CacheManager: null
      at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:127)
      at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:167)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
      at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:767)
      at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:693)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1003)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:348)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:176)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:105)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:957)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:768)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:330)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
      ******************
      The Spring context is loaded through a ServiceLocator (Singelton) and initiated by a class that implements the ServletContextListener.

      I've create our own ehcache.xml and i even tried adding it to the classpath element of the Manifest files for both the war and ejb-file.

      Any ideas?

      Thanks,
      Maarten