2
votes

This is an intermittent problem, roughly 4/5 starts hit null pointer. Camel-Context.xml is below.

  • Error:

    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)
    
  • Camel-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&amp;broker.useJmx=false" />
                </bean>
            </property>
        </bean>

        <!-- Screen output endpoint -->
        <bean id="outputToScreen"
            class="com.softwareag.eda.NERD.outputToScreen">
        </bean>

    </beans>
4
Which OS and JDK are you using?Claus Ibsen
This result came from Windows 64 and JDK17. I have moved to JDK16 to use ServiceMix and the issue has not resurfaced.Bevo

4 Answers

5
votes

I came across your question due to experiencing the same problem. On Feb 18, 2012 the 2.2.5 version of JAXB was released. After upgrading to 2.2.5, the problem seems to have been resolved. So far, it hasn't occurred again in testing.

See http://jaxb.java.net/ for details.

For reference, my configuration uses Camel 2.8.4 and Spring 3.0.5.

2
votes

The problem is also mentioned here and it has an statement from Claus Ibsen here. You solved it already, it is Java 7.

2
votes

Same thing for 1.6.0_30-b12 (32 bit) with Camel 2.8 and 2.9
I've downgraded my jaxb-impl version from 2.2.4 to 2.2.3.

I think it's not a JDK, but a JAXB issue :
C:\java\jdk1.7.0_03\bin\xjc.exe -version
xjc 2.2.4

0
votes

It is fixed in JBoss 7.1.2. So you need to fix it yourself in JBoss 7.1.1

You can find more about this issue here.