[jboss-user] [EJB/JBoss] - Re: Classloader nightmare and ClassCastException. Isolatio
tnine
do-not-reply at jboss.com
Tue Apr 8 03:27:56 EDT 2008
I'm using the following version of Hibernate and Spring
Hibernate 3.2.6.ga
Hibernate Annotations 3.3.0.ga
Spring Framework 2.0.5
Here's the stacktrace
| 19:24:05,422 ERROR [JMSContainerInvoker] Exception in JMSCI message listener
| javax.ejb.TransactionRolledbackLocalException: Could not instantiate bean
| at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:262)
| at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
| at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
| at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
| at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
| at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
| at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402)
| at org.jboss.ejb.Container.invoke(Container.java:954)
| at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:987)
| at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1287)
| at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
| at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:905)
| at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
| at org.jboss.mq.SpySession.run(SpySession.java:323)
| at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
| at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
| at java.lang.Thread.run(Thread.java:613)
| Caused by: javax.ejb.EJBException: Could not instantiate bean
| at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:206)
| at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:87)
| at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
| at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
| ... 16 more
| Caused by: javax.ejb.EJBException: org.springframework.beans.factory.access.BootstrapException: Unable to return specified BeanFactory instance: factory key [statementsMdb], from group with resource name [classpath*:beanRefContext.xml]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'statementsMdb' defined in URL [jar:file:/Users/toddnine/work/servers/jboss-4.0.5.GA/server/pefcu/tmp/deploy/tmp59925statements-app-1.0.0-beta-4-SNAPSHOT.ear-contents/mdb-1.0.0-beta-4-SNAPSHOT.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Illegal arguments for constructor; nested exception is java.lang.IllegalArgumentException: java.lang.ClassCastException at bfefb9
| at org.jboss.ejb.MessageDrivenEnterpriseContext.<init>(MessageDrivenEnterpriseContext.java:94)
| at org.jboss.ejb.plugins.MessageDrivenInstancePool.create(MessageDrivenInstancePool.java:50)
| at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:184)
| ... 19 more
| Caused by: org.springframework.beans.factory.access.BootstrapException: Unable to return specified BeanFactory instance: factory key [statementsMdb], from group with resource name [classpath*:beanRefContext.xml]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'statementsMdb' defined in URL [jar:file:/Users/toddnine/work/servers/jboss-4.0.5.GA/server/pefcu/tmp/deploy/tmp59925statements-app-1.0.0-beta-4-SNAPSHOT.ear-contents/mdb-1.0.0-beta-4-SNAPSHOT.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Illegal arguments for constructor; nested exception is java.lang.IllegalArgumentException: java.lang.ClassCastException at bfefb9
| at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:405)
| at org.springframework.ejb.support.AbstractEnterpriseBean.loadBeanFactory(AbstractEnterpriseBean.java:116)
| at org.springframework.ejb.support.AbstractMessageDrivenBean.ejbCreate(AbstractMessageDrivenBean.java:78)
| at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.ejb.MessageDrivenEnterpriseContext.<init>(MessageDrivenEnterpriseContext.java:82)
| ... 21 more
| Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'statementsMdb' defined in URL [jar:file:/Users/toddnine/work/servers/jboss-4.0.5.GA/server/pefcu/tmp/deploy/tmp59925statements-app-1.0.0-beta-4-SNAPSHOT.ear-contents/mdb-1.0.0-beta-4-SNAPSHOT.jar!/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Illegal arguments for constructor; nested exception is java.lang.IllegalArgumentException: java.lang.ClassCastException at bfefb9
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:451)
| 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.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:733)
| at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:395)
| ... 27 more
| Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Illegal arguments for constructor; nested exception is java.lang.IllegalArgumentException: java.lang.ClassCastException at bfefb9
| at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:96)
| at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
| at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:186)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:800)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:720)
| at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:387)
| ... 33 more
| Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException at bfefb9
| at sun.reflect.GeneratedConstructorAccessor39.newInstance(Unknown Source)
| at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
| at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
| at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85)
| ... 38 more
|
Perhaps I missed the point, but I thought that scoped classloaders with override would allow me to use any version I choose. Is that not correct? Coincidentally, it works with Hibernate 3.2.0.ga and Annotations 3.2.0.ga.
Thanks,
Todd
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4142261#4142261
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4142261
More information about the jboss-user
mailing list