-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Having problems upgrading to hibernate 3.6
PostPosted: Sun Jan 23, 2011 2:51 pm 
Newbie

Joined: Sun Jan 23, 2011 12:50 pm
Posts: 2
Apologies if this has been asked before but I have been unable to solve the problem on my own through research.

I am trying to upgrade to Hibernate 3.6.0 (from 3.5.2). I'm using JBoss 4.2, spring 2.1, and the code contains a combination of hbm files and annotations and makes reference to ehcache as well. I can upgrade spring by the way, but I'd prefer not to just yet if I didn't have to.

Anyway, I seem to be unable to find the right combination of hibernate jars right now. The closest I came was with these:

Code:
* hibernate-commons-annotations-3.2.0.Final.jar
* hibernate-c3p0-3.6.0.Final.jar
* hibernate-core-3.6.0.Final.jar
* hibernate-jpa-2.0-api-1.0.0.Final.jar
* hibernate-ehcache-3.6.0.Final.jar
* hibernate-validator-3.0.0.GA.jar


I may not need all of those but JBoss seems to start without error with that combination. However my unit tests fail on save operations with this stack trace:

Code:
java.lang.NoSuchMethodError: org.hibernate.event.PreInsertEvent.getSource()Lorg/hibernate/engine/SessionImplementor;
at org.hibernate.validator.event.ValidateEventListener.onPreInsert(ValidateEventListener.java:172)
at org.hibernate.action.EntityInsertAction.preInsert(EntityInsertAction.java:178)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:72)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:184)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:51)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1216)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:383)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:133)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:555)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:662)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:632)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:314)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:117)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:113)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy44.save(Unknown Source)
....


At this point I started trying varying combinations of jars. Namely I tried upgrading to hibernate-validator-4.0.1.Final, but no matter what, I always seem to run into this error when starting up JBoss now:

Code:
...
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: java.lang.NoSuchMethodException:
org.hibernate.validator.ClassValidator.<init>(java.lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hibernate.annotations.common.reflection.Reflecti
onManager)
Caused by:
org.hibernate.AnnotationException: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.<init>(java.lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hibernate.annotations.common.reflection.ReflectionManager)
        at org.hibernate.cfg.Configuration.applyHibernateValidatorLegacyConstraintsOnDDL(Configuratio
n.java:1651)
        at org.hibernate.cfg.Configuration.applyConstraintsToDDL(Configuration.java:1623)
        at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1415)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1826)
        at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionF
actoryBean.java:728)
        at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessio
nFactoryBean.java:668)
        at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractS
essionFactoryBean.java:211)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMet
hods(AbstractAutowireCapableBeanFactory.java:1201)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBea
n(AbstractAutowireCapableBeanFactory.java:1171)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(Ab
stractAutowireCapableBeanFactory.java:425)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFact
ory.java:251)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(Defaul
tSingletonBeanRegistry.java:156)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.
java:248)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.
java:160)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(Bea
nDefinitionValueResolver.java:261)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecess
ary(BeanDefinitionValueResolver.java:109)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyProperty
Values(AbstractAutowireCapableBeanFactory.java:1099)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(
AbstractAutowireCapableBeanFactory.java:861)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(Ab
stractAutowireCapableBeanFactory.java:421)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFact
ory.java:251)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(Defaul
tSingletonBeanRegistry.java:156)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.
java:248)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.
java:160)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(Bea
nDefinitionValueResolver.java:261)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecess
ary(BeanDefinitionValueResolver.java:109)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyProperty
Values(AbstractAutowireCapableBeanFactory.java:1099)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(
AbstractAutowireCapableBeanFactory.java:861)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(Ab
stractAutowireCapableBeanFactory.java:421)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFact
ory.java:251)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(Defaul
tSingletonBeanRegistry.java:156)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.
java:248)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.
java:160)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(Bea
nDefinitionValueResolver.java:261)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecess
ary(BeanDefinitionValueResolver.java:109)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyProperty
Values(AbstractAutowireCapableBeanFactory.java:1099)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(
AbstractAutowireCapableBeanFactory.java:861)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(Ab
stractAutowireCapableBeanFactory.java:421)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFact
ory.java:251)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(Defaul
tSingletonBeanRegistry.java:156)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.
java:248)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.
java:160)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSinglet
ons(DefaultListableBeanFactory.java:287)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplication
Context.java:352)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.ja
va:244)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java
:187)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderList
ener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        ...


I have no idea where org.hibernate.validator.ClassValidator is nor do I know who is requiring it.

Currently I am at a loss. Is this a jar dependency issue? If so, what jars do I need? If not, should I make any code changes? Any help would be greatly appreciated on this issue.


Top
 Profile  
 
 Post subject: Re: Having problems upgrading to hibernate 3.6
PostPosted: Sun Jan 23, 2011 8:38 pm 
Newbie

Joined: Sun Jan 23, 2011 12:50 pm
Posts: 2
So the problem was with JBoss 4.2.3, which includes incompatible versions of hibernate in jboss/server/default/lib. Removing them resolved the issue.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.