camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hendrik Schöneberg (JIRA) <j...@apache.org>
Subject [jira] [Updated] (CAMEL-5457) NPE in CamelNamespaceHandler
Date Mon, 23 Jul 2012 08:04:35 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-5457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Hendrik Schöneberg updated CAMEL-5457:
--------------------------------------

    Attachment: NPETest.zip
    
> NPE in CamelNamespaceHandler
> ----------------------------
>
>                 Key: CAMEL-5457
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5457
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-spring
>    Affects Versions: 2.10.0
>         Environment: Ubuntu 12.04 64bit, Oracle JDK 7 64bit (build 1.7.0_05-b05), camel-{core,
jms, spring}-2.10.0, spring-{beans, context, etc...}-3.1.2.RELEASE
>            Reporter: Hendrik Schöneberg
>            Assignee: Willem Jiang
>         Attachments: NPETest.zip
>
>
> Hey everyone,
> after updating to JDK 7 I keep running into problems when starting up my Spring application:
The system crashes with a NPE thrown within the CamelNamespaceHandler in about 30% of all
startups.
> {quote}
> Caused by: java.lang.NullPointerException
> 	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.checkOverrideProperties(ClassBeanInfoImpl.java:190)
> 	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:171)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:513)
> 	at com.sun.xml.internal.bind.v2.runtime.property.ArrayReferenceNodeProperty.<init>(ArrayReferenceNodeProperty.java:72)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
> 	at com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:113)
> 	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:166)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)
> 	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:153)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:513)
> 	at com.sun.xml.internal.bind.v2.runtime.property.ArrayReferenceNodeProperty.<init>(ArrayReferenceNodeProperty.java:72)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
> 	at com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:113)
> 	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:166)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:513)
> 	at com.sun.xml.internal.bind.v2.runtime.property.ArrayReferenceNodeProperty.<init>(ArrayReferenceNodeProperty.java:72)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
> 	at com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:113)
> 	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:166)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)
> 	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:153)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:513)
> 	at com.sun.xml.internal.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:90)
> 	at sun.reflect.GeneratedConstructorAccessor15.newInstance(Unknown Source)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
> 	at com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:113)
> 	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:166)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:513)
> 	at com.sun.xml.internal.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:97)
> 	at com.sun.xml.internal.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:47)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
> 	at com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:113)
> 	at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:166)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:311)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:126)
> 	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1142)
> 	at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:130)
> 	at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:221)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:172)
> 	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:132)
> 	at javax.xml.bind.ContextFinder.find(ContextFinder.java:347)
> 	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:431)
> 	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:394)
> 	at org.apache.camel.spring.handler.CamelNamespaceHandler.createJaxbContext(CamelNamespaceHandler.java:187)
> 	at org.apache.camel.spring.handler.CamelNamespaceHandler.getJaxbContext(CamelNamespaceHandler.java:174)
> 	at org.apache.camel.spring.handler.CamelNamespaceHandler$CamelContextBeanDefinitionParser.doParse(CamelNamespaceHandler.java:302)
> 	at org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:85)
> 	at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59)
> 	at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
> 	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1419)
> 	at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1409)
> 	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)
> 	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)
> 	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
> 	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
> 	... 39 more
> {quote}
> From the _beans.xml_ I include additional xmls for JMS-Broker creation (Apache ActiveMQ
5.6.0) and camel route setup, the camel config file is as follows:
> {quote}
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
> 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring"
> 	xsi:schemaLocation="http://www.springframework.org/schema/beans 
> 						http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
>        					http://camel.apache.org/schema/spring
>        					http://camel.apache.org/schema/spring/camel-spring-2.10.0.xsd						
>    						">
> 	<!-- JMS RELATED STUFF -->
> 	<!-- connection factory -->
> 	<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"
> 		depends-on="wuesyphusBroker">
>                ...
> 	</bean>
> 	<bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory"
> 		depends-on="wuesyphusBroker">
>         ...
> 	</bean>
> 	<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration"
> 		depends-on="wuesyphusBroker">
> 		<property name="connectionFactory" ref="pooledConnectionFactory" />
> 		<property name="transacted" value="false" />
> 	</bean>
> 	<!-- camel component -->
> 	<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"
> 		depends-on="wuesyphusBroker">
> 		<property name="configuration" ref="jmsConfig" />
> 	</bean>
> 	<!-- camel setup -->
> 	<camel:camelContext id="camelContext">
> 		<!-- prepare templates -->
> 		<camel:template id="tpl_broadcast" defaultEndpoint="activemq:topic:wuesyphus.broadcast"
/>
> 		<camel:template id="tpl_reply" defaultEndpoint="direct:reply" />
> 		<!-- define endpoints -->
> 		<!-- ... for debug -->
> 		<camel:endpoint id="ep_err" uri="stream:err" />
> 		<!-- ... for jms -->
> 		<camel:endpoint id="ep_server_broadcast" uri="activemq:topic:wuesyphus.broadcast"
/>
> 		<camel:endpoint id="ep_server_msg" uri="activemq:queue:wuesyphus.msg" />
> 		<!-- ... for beans -->
> 		<camel:endpoint id="ep_bean_wuesyphuscontroller"
> 			uri="bean:wuesyphuscontroller?method=inbox( ${headers}, ${body} )" />
> 		<!-- ... for direct input -->
> 		<camel:endpoint id="ep_reply" uri="direct:reply" />
> 		<!-- define routes -->
> 		<!-- standard message route -->
> 		<camel:route>
> 			<camel:from ref="ep_server_msg" />
> 			<camel:to ref="ep_bean_wuesyphuscontroller" />
> 		</camel:route>
> 		<!-- context based router -->
> 		<camel:route>
> 			<camel:from ref="ep_reply" />
> 			<camel:recipientList ignoreInvalidEndpoints="true">
> 				<camel:header>recipient</camel:header>
> 			</camel:recipientList>
> 		</camel:route>
> 	</camel:camelContext>
> 	<!-- some other beans -->
> </beans>
> {quote}
> Kind regards,
> Hendrik Schöneberg

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message