camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Nyheim <paul.nyh...@gmail.com>
Subject Occational NPE in CamelNamespaceHandler
Date Tue, 23 Aug 2011 13:16:24 GMT
Hi.
Occationally I get a NPE that seems related to CamelNamespaceHandler
when running under Java 7. Switching back to Java 6 I don't seem to
get this problem.

The problem seems very similar to the one from this thread
http://camel.465427.n5.nabble.com/Occasional-CamelNamespaceHandler-exception-when-running-with-Spring-DM-1-2-tt476984.html
, however as the thread is quite old, I would like to know if anyone
else has experienced this, and how to avoid it.

My setup is a Grails 1.3.7 Application, using Camel 2.8.0, jdk1.7.0

I have a camelContext configured in the spring resources.xml like this:

  <camel:camelContext id="camel">
    <camel:routeBuilder ref="eventReceiverRouteBuilder" />
  </camel:camelContext>

I also get the same error if I try to configure it in resources.groovy
like this:

 xmlns camel: 'http://camel.apache.org/schema/spring'

    camel{
        camelContext(id:"camel"){
            routeBuilder(ref:"eventReceiverRouteBuilder")
        }
    }

Relevant parts of stacktrace: (complete stacktrace posted here:
http://pastebin.com/b88JZx6z )

2011-08-23 14:53:20,918 [main] WARN  spring.GrailsRuntimeConfigurator
- [RuntimeConfiguration] Unable to perform post initialization config:
/WEB-INF/spring/resources.xml
org.springframework.beans.factory.BeanDefinitionStoreException:
Unexpected exception parsing XML document from URL
[file:./grails-app/conf/spring/resources.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.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:73)
......
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 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:185)
	at org.apache.camel.spring.handler.CamelNamespaceHandler.getJaxbContext(CamelNamespaceHandler.java:172)
	at org.apache.camel.spring.handler.CamelNamespaceHandler$CamelContextBeanDefinitionParser.doParse(CamelNamespaceHandler.java:300)
	at org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:85)

Regards,
Paul Nyheim

Mime
View raw message