首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在卡拉夫上跑步时在org.apache.ibatis.session.SqlSessionFactoryBuilder.build上的java.lang.NullPointerException

在卡拉夫上跑步时在org.apache.ibatis.session.SqlSessionFactoryBuilder.build上的java.lang.NullPointerException
EN

Stack Overflow用户
提问于 2013-07-24 14:14:22
回答 1查看 1.1K关注 0票数 -1

在karaf中运行示例应用程序时出现以下异常。我已经将maven build jar放在servicemix/deploy中。请帮帮忙,因为我对camel、mybatis和servicemix还不熟悉。

代码语言:javascript
复制
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [bundle://278.0:0/META-INF/spring/camelContext.xml]; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)[77:org.springframework.osgi.core:1.2.1]
    at org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)[77:org.springframework.osgi.core:1.2.1]
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[71:org.springframework.context:3.0.7.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)[71:org.springframework.context:3.0.7.RELEASE]
    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)[77:org.springframework.osgi.core:1.2.1]
    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)[77:org.springframework.osgi.core:1.2.1]
    at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[77:org.springframework.osgi.core:1.2.1]
    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)[77:org.springframework.osgi.core:1.2.1]
    at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)[80:org.springframework.osgi.extender:1.2.1]
    at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)[80:org.springframework.osgi.extender:1.2.1]
    at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)[77:org.springframework.osgi.core:1.2.1]
    at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)[80:org.springframework.osgi.extender:1.2.1]
    at java.lang.Thread.run(Thread.java:722)[:1.7.0_03]
Caused by: java.lang.NullPointerException
    at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.checkOverrideProperties(ClassBeanInfoImpl.java:190)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:171)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:513)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.property.ArrayReferenceNodeProperty.<init>(ArrayReferenceNodeProperty.java:72)[:1.7.0_03]
    at sun.reflect.GeneratedConstructorAccessor35.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.7.0_03]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:113)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:166)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:153)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:513)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.property.ArrayReferenceNodeProperty.<init>(ArrayReferenceNodeProperty.java:72)[:1.7.0_03]
    at sun.reflect.GeneratedConstructorAccessor35.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.7.0_03]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:113)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:166)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:513)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.property.ArrayReferenceNodeProperty.<init>(ArrayReferenceNodeProperty.java:72)[:1.7.0_03]
    at sun.reflect.GeneratedConstructorAccessor35.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.7.0_03]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:113)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:166)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:153)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:513)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.property.SingleElementNodeProperty.<init>(SingleElementNodeProperty.java:90)[:1.7.0_03]
    at sun.reflect.GeneratedConstructorAccessor24.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.7.0_03]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:113)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:166)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:513)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:97)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:47)[:1.7.0_03]
    at sun.reflect.GeneratedConstructorAccessor28.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.7.0_03]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:113)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:166)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:494)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:311)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:126)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1142)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:130)[:1.7.0_03]
    at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:221)[:1.7.0_03]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_03]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_03]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_03]
    at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_03]
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:143)[:2.2.0]
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:310)[:2.2.0]
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:412)[:2.2.0]
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:375)[:2.2.0]
    at org.apache.camel.spring.handler.CamelNamespaceHandler.createJaxbContext(CamelNamespaceHandler.java:187)[96:org.apache.camel.camel-spring:2.10.4]
    at org.apache.camel.spring.handler.CamelNamespaceHandler.getJaxbContext(CamelNamespaceHandler.java:174)[96:org.apache.camel.camel-spring:2.10.4]
    at org.apache.camel.spring.handler.CamelNamespaceHandler$CamelContextBeanDefinitionParser.doParse(CamelNamespaceHandler.java:302)[96:org.apache.camel.camel-spring:2.10.4]
    at org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser.parseInternal(AbstractSingleBeanDefinitionParser.java:85)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.beans.factory.xml.AbstractBeanDefinitionParser.parse(AbstractBeanDefinitionParser.java:59)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1338)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1328)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)[69:org.springframework.beans:3.0.7.RELEASE]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)[69:org.springframework.beans:3.0.7.RELEASE]
    ... 18 more

以下是我的配置文件

代码语言:javascript
复制
<camel:camelContext trace="false"> 
    <camel:route id="insertOrder"> 
    <camel:from uri="timer:foo?period=20s">
    </camel:from> 
    <camel:log message="Routing Mybatis started........">
    </camel:log> 
    <camel:transform> 
    <camel:method ref="orderService" method="generateOrder"/> 
    </camel:transform> 
    <camel:to uri="mybatis:insertOrder?statementType=Insert"/> 
</camel:route>
EN

回答 1

Stack Overflow用户

发布于 2013-07-24 14:45:17

升级您的JDK版本,因为JDK 1.7的早期版本有错误的JAXB,这是您遇到的例外。

您可以使用1.7.0_03。还有更新的版本。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17826480

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档