[jboss-user] [EJB/JBoss] - Re: Classloader nightmare and ClassCastException. Isolatio
tnine
do-not-reply at jboss.com
Tue Apr 8 22:26:29 EDT 2008
Well, I found a work around by following the formula from the previous post. I was getting the following exception at the bottom of my trace. I accidentally posted the wrong section in my earlier post
| Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateSessionFactory' defined in class path resource [statements-mdb.xml]: Invocation of init method failed; nested exception is java.lang.ClassCastException: org.hibernate.validator.event.ValidateEventListener
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1175)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:428)
| at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
| at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.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(BeanDefinitionValueResolver.java:261)
| ... 59 more
| Caused by: java.lang.ClassCastException: org.hibernate.validator.event.ValidateEventListener
| at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:783)
| at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
| at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
| at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1202)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
| ... 65 more
|
So, I went digging for what project the class org.hibernate.validator.event.ValidateEventListener is a member of. Its used in the hibernate validator project. I added the hibernate-validator jar version 3.3.0.ga to my MDB's dependencies. As soon as I deployed with this additional jar, my issue was solved. I'm still not sure why Hibernate was trying to load this class, since I don't need it to perform my integration testing. Hopefully this will help someone else out!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4142546#4142546
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4142546
More information about the jboss-user
mailing list