5 Replies Latest reply on Nov 7, 2007 9:09 AM by Brian Stansberry

    JBossCache 2 and Hibernate 3.2 compatibility

    Grzegorz Trafny Newbie

      Hello,

      I'd like to run H3.2 with JBC2 but after first attempts I noticed problem with
      java.lang.NoClassDefFoundError: org/jboss/cache/TransactionManagerLookup (full stack at the end of this letter).

      After some investigation I noticied that Hibernate 3.2.4.sp1 contains such code:

      package org.hibernate.cache;
      public class TreeCacheProvider implements CacheProvider {
       static final class TransactionManagerLookupAdaptor implements org.jboss.cache.TransactionManagerLookup {
       //...
       }
      }


      If we check JBossCache 2.0.0-CR2 then we will see that org.jboss.cache.TransactionManagerLookup is not available in the JBossCache code. Probably Hibernate should call org.jboss.cache.transaction.TransactionManagerLookup.


      So, to recap: is H3.2 is compatibile with JBC2??


      BTW. I have to make note that I ran this H3 without any JBS2 configuration files.


      Thanks for your time.
      Best Regards
      GT


      java.lang.NoClassDefFoundError: org/jboss/cache/TransactionManagerLookup
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
      at java.lang.Class.getConstructor0(Class.java:2671)
      at java.lang.Class.newInstance0(Class.java:321)
      at java.lang.Class.newInstance(Class.java:303)
      at org.hibernate.cfg.SettingsFactory.createCacheProvider(SettingsFactory.java:358)
      at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:232)
      at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2006)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1289)
      at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
      at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:807)
      at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:740)
      at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:131)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1062)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1029)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:420)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:246)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:128)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:955)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:729)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:416)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:246)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:128)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:955)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:729)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:416)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:246)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:128)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:955)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:729)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:416)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:290)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348)
      at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
      at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
      at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
      at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
      at org.apache.catalina.core.StandardService.start(StandardService.java:448)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)