cancel
Showing results for 
Search instead for 
Did you mean: 

Unstable Hibernate on Linux (Hibernate ticket HHH-1293)

gentyjp
Champ in-the-making
Champ in-the-making
Hi

I had some big problems with hibernate stability on linux boxes.
Happily I think I kind of solved it.

My two linux boxes:

1)
Distrib : Mandriva 2006.0
Kernel : 2.6.12-12mdksmp
Java : SUN 1.5.0_07
MySQL : Ver 14.12 Distrib 5.0.21
MySQL connector : mysql-connector-java-3.1.12-bin.jar
Tomcat : 5.5.17
Alfresco : 1.4 preview war file

2)
Distrib : Centos 4.2
Kernel : 2.6.9-22.EL
Java : SUN 1.5.0_08
MySQL : Ver 14.12 Distrib 5.0.22
MySQL connector : mysql-connector-java-3.1.12-bin.jar
Tomcat : 5.5.17
Alfresco : 1.4 preview war file

I also have two Windows XP boxes with Java 1.5.0_07.
I wanted to do a tiny stability test for my AlFresco Linux and Windows boxes.
I took the last SDK 1.4 preview.
I modified the ContentReadAndWrite.java in web services samples.
I added a "for i" loop starting at the very start of the program and ending at the very end.
The loop should do 20 iterations.

On Windows boxes everything run fine. I tested for 100 iteration, no problems.
My two Linux boxes AlFresco crashes after ~15 iterations.
An exception is raised:
java.lang.NoSuchMethodError: java.lang.Object.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer;

I searched on internet and found the HHH-1293 ticket
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1293

It fully describes my problem.

I downloaded the last release candidate Hibernate Core 3.2.CR4.
I replaced hibernate-3.1.3.jar with hibernate3.jar found in the download.

I tested for 100 iterations and everything ran smoothly, great !!!!!

Could you please take this big problem in account and certainly update the hibernate jar file in the next release ?

  I can give you more information if you need.

Thanks

Best regards

Jean-Paul
4 REPLIES 4

derek
Star Contributor
Star Contributor
Hi,

Thanks for the valuable workaround tip.

I'm afraid that we won't be putting the Hibernate CR into 1.4.  If it goes final before we release our final, then there is a chance.  We could patch our version of Hibernate, but then we'd have to trust that the problem has been fix as opposed to just not raised its ugly head.

It's going to be a pain to support, but I'd rather support a fully tested Hibernate release with a workaround than a patched version fixed this late in the release cycle.

Regards

gentyjp
Champ in-the-making
Champ in-the-making
Hi Derek


Thanks for your reply.

Too bad you can't integrate the new Hibernate but I understand.

  How does it come it seems I'am the one to have this problem ?

  I also have it with 1.3 release.

(Memory settings in Tomcat are 128m regular , max 512m)

Can you detect something I do wrong or something inappropriate  in my settings ?

Thanks

Jean-Paul

blentz
Champ in-the-making
Champ in-the-making
I just started having java.lang.Object.getHibernateLazyInitializer()Lorg/hibernate/proxy/LazyInitializer;  errors on my install of 1.3 on Linux after enabling ldap synchronization of our entire domain.

I tried your solution of replacing the hibernate-3.1.3.jar with hibernate3.jar from Hibernate Core 3.2.CR4, but instead I get:

23:22:07,098 ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'systemInfoBootstrap' defined in class path resource [alfresco/bootstrap-context.xml]: Can't resolve reference to bean 'transactionComponent' while setting property 'transactionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionComponent' defined in class path resource [alfresco/core-services-context.xml]: Can't resolve reference to bean 'transactionManager' while setting property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [alfresco/hibernate-context.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 class path resource [alfresco/hibernate-context.xml]: Initialization of bean failed; nested exception is org.hibernate.cache.CacheException: Attempt to restart an already started EhCacheProvider. Use sessionFactory.close()  between repeated calls to buildSessionFactory. Consider using net.sf.ehcache.hibernate.SingletonEhCacheProvider.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionComponent' defined in class path resource [alfresco/core-services-context.xml]: Can't resolve reference to bean 'transactionManager' while setting property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [alfresco/hibernate-context.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 class path resource [alfresco/hibernate-context.xml]: Initialization of bean failed; nested exception is org.hibernate.cache.CacheException: Attempt to restart an already started EhCacheProvider. Use sessionFactory.close()  between repeated calls to buildSessionFactory. Consider using net.sf.ehcache.hibernate.SingletonEhCacheProvider.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [alfresco/hibernate-context.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 class path resource [alfresco/hibernate-context.xml]: Initialization of bean failed; nested exception is org.hibernate.cache.CacheException: Attempt to restart an already started EhCacheProvider. Use sessionFactory.close()  between repeated calls to buildSessionFactory. Consider using net.sf.ehcache.hibernate.SingletonEhCacheProvider.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [alfresco/hibernate-context.xml]: Initialization of bean failed; nested exception is org.hibernate.cache.CacheException: Attempt to restart an already started EhCacheProvider. Use sessionFactory.close()  between repeated calls to buildSessionFactory. Consider using net.sf.ehcache.hibernate.SingletonEhCacheProvider.
org.hibernate.cache.CacheException: Attempt to restart an already started EhCacheProvider. Use sessionFactory.close()  between repeated calls to buildSessionFactory. Consider using net.sf.ehcache.hibernate.SingletonEhCacheProvider.
        at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:134)
        at org.alfresco.repo.cache.InternalEhCacheManagerFactoryBean.start(InternalEhCacheManagerFactoryBean.java:162)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:183)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
        at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:800)
        at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:726)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1059)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
        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:1013)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:824)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:345)
        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:1013)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:824)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:345)
        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:1013)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:824)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:345)
        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.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:203)
        at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:614)
        at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:496)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:317)
        at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
        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:3729)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
        at org.apache.catalina.core.StandardService.start(StandardService.java:450)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
Caused by: net.sf.ehcache.CacheException: Cannot parseConfiguration CacheManager. Attempt to create a new instance of CacheManager using the diskStorePath "/usr/share/tomcat/temp" which is already used by an existing CacheManager. The source of the configuration was classpath.
        at net.sf.ehcache.CacheManager.configure(CacheManager.java:248)
        at net.sf.ehcache.CacheManager.init(CacheManager.java:193)
        at net.sf.ehcache.CacheManager.<init>(CacheManager.java:180)
        at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:124)
        … 62 more

gentyjp
Champ in-the-making
Champ in-the-making
Hi

  I'am happy to see I'am not the one to have this problem  Smiley Surprisedops:

   I also tried to replace the hibernate-3.1.3.jar with hibernate3.jar in AlFresco 1.3, but the replacement only works with AlFresco 1.4,  Smiley Sad .

  I just can't use AlFresco 1.3 under Linux. (And I can't use 1.4 coz repository WSDL changed and don't work anymore with dotNET, http://forums.alfresco.com/viewtopic.php?t=3211)

    Could you do the little test with ContentReadAndWrite.java  to see if you systematically reproduct this problem ?

    You just have to import projects from SDK 1.3, had a loop as described in my previous post, and see ..

   Thanks

      Regards

Jean-Paul