这是一个间歇性问题,大约4/5开始命中空指针。 Camel-Context.xml位于下方。
错误:
2011-10-18 08:31:25,245 [main ] INFO MainSupport - Apache Camel 2.8.0 stopping
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from file [D:\Users\michaelb\workspace\camel-example-spring-eda\target\classes\META-INF\spring\camel-context-NERD.xml]; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
at org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:185)
at org.apache.camel.spring.Main.doStart(Main.java:139)
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
at org.apache.camel.impl.MainSupport.run(MainSupport.java:136)
at org.apache.camel.impl.MainSupport.run(MainSupport.java:322)
at com.softwareag.eda.NERD.main(NERD.java:39)
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)
骆驼context.xml中
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> org.apache.camel.example.spring.eda
<!-- Announce route -->
<route id="Announcer" startupOrder="3">
<from uri="file:src/data?noop=true" />
<choice>
<when>
<xpath>$eventtype = 'shipment'</xpath>
<to uri="jmsEDA:topic:orderMgmt" />
</when>
<otherwise>
<to uri="jmsEDA:topic:orderMgmt" />
</otherwise>
</choice>
</route>
<!-- Listen route -->
<route id="Listener" startupOrder="2">
<from uri="jmsEDA:topic:orderMgmt" />
<to uri="file://target/test?noop=true" />
<to uri="outputToScreen" />
<log message="done" />
</route>
</camelContext>
<!-- EDA JMS endpoint URL -->
<bean id="jmsEDA" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL"
value="vm://localhost?broker.persistent=false&broker.useJmx=false" />
</bean>
</property>
</bean>
<!-- Screen output endpoint -->
<bean id="outputToScreen"
class="com.softwareag.eda.NERD.outputToScreen">
</bean>
</beans>
答案 0 :(得分:5)
由于遇到同样的问题,我遇到了你的问题。 2012年2月18日,发布了2.2.5版本的JAXB。升级到2.2.5后,问题似乎已经解决。到目前为止,它还没有再次发生过测试。
有关详细信息,请参阅http://jaxb.java.net/。
作为参考,我的配置使用Camel 2.8.4和Spring 3.0.5。
答案 1 :(得分:2)
答案 2 :(得分:2)
1.6.0_30-b12(32位)与Camel 2.8和2.9的相同 我已经将我的jaxb-impl版本从2.2.4降级到2.2.3。
我认为这不是JDK,而是JAXB问题:
C:\java\jdk1.7.0_03\bin\xjc.exe -version
xjc 2.2.4
答案 3 :(得分:0)