It could be easier for us to trace the issue if you can provide more 
information about your bean and the camel route.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On May 14, 2014 at 5:10:41 AM, Shiv ([email protected]) wrote:
> Hi,
> I am using a bean in my camel route to load an XML file and do further
> processing. When I deploy the bundle, I am getting below error. If I run the
> same code snippet in a standalone Java class, it works fine.
> Do I need to change my XML parsing logic? Seems like XPath.evaluate() is
> causing issue in bean initialization.
>  
> org.springframework.beans.factory.BeanCreationException: Error creating bean  
> with name 'messageTransformer' defined in URL
> [bundle://258.5:0/META-INF/spring/bundle-context.xml]: Instantiation of bean  
> failed; nested exception is
> org.springframework.beans.BeanInstantiationException: Could not instantiate  
> bean class [com.test.MessageTransformer]: Constructor threw exception;
> nested exception is java.lang.RuntimeException:
> java.lang.ClassCastException: java.util.ArrayList cannot be cast to
> org.w3c.dom.NodeList
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:997)[105:org.springframework.beans:3.1.3.RELEASE]
>   
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)[105:org.springframework.beans:3.1.3.RELEASE]
>   
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)[105:org.springframework.beans:3.1.3.RELEASE]
>   
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)[105:org.springframework.beans:3.1.3.RELEASE]
>   
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)[105:org.springframework.beans:3.1.3.RELEASE]
>   
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)[105:org.springframework.beans:3.1.3.RELEASE]
>   
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)[105:org.springframework.beans:3.1.3.RELEASE]
>   
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)[105:org.springframework.beans:3.1.3.RELEASE]
>   
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:605)[105:org.springframework.beans:3.1.3.RELEASE]
>   
> at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)[106:org.springframework.context:3.1.3.RELEASE]
>   
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[133:org.springframework.osgi.core:1.2.1]
>   
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[133:org.springframework.osgi.core:1.2.1]
>   
> at
> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[133:org.springframework.osgi.core:1.2.1]
>   
> at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[133:org.springframework.osgi.core:1.2.1]
>   
> at
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[132:org.springframework.osgi.extender:1.2.1]
>   
> at java.lang.Thread.run(Thread.java:662)[:1.6.0_45]
>  
> Thanks
> Shiv
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/ClassCastException-in-XML-Parsing-JBoss-Fuse-ESB-6-0-tp5751062.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  

Reply via email to