0

嗨,我在这里学习本教程。自从我下载了他们的代码以来,代码,xml文件完全相同。但是,当我将 WAR 文件复制到 Tomcat 7 服务器时,出现以下错误

SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadfile': Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
    at org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener.getStaticService(WSDiscoveryServerListener.java:66)
    at org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener.getService(WSDiscoveryServerListener.java:58)
    at org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener.startServer(WSDiscoveryServerListener.java:73)
    at org.apache.cxf.bus.managers.ServerLifeCycleManagerImpl.startServer(ServerLifeCycleManagerImpl.java:61)
    at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:146)
    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:360)
    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)
    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:537)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1546)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1487)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1419)
    ... 22 more
Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadfile': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: java.lang.NullPointerException
    at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:151)
    at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:122)
    at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:94)
    at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:83)
    at org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener$WSDiscoveryServiceImplHolder.<clinit>(WSDiscoveryServerListener.java:44)
    ... 37 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadfile': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: java.lang.NullPointerException
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1422)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:518)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.apache.cxf.bus.spring.BusApplicationContext$1.run(BusApplicationContext.java:107)
    at org.apache.cxf.bus.spring.BusApplicationContext$1.run(BusApplicationContext.java:105)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.cxf.bus.spring.BusApplicationContext.<init>(BusApplicationContext.java:105)
    at org.apache.cxf.bus.spring.SpringBusFactory.createApplicationContext(SpringBusFactory.java:157)
    at org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:148)
    ... 41 more
Caused by: javax.xml.ws.WebServiceException: java.lang.NullPointerException
    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:369)
    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)
    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:537)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1546)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1487)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1419)
    ... 56 more
Caused by: java.lang.NullPointerException
    at java.util.concurrent.ConcurrentHashMap.put(Unknown Source)
    at org.apache.cxf.bus.CXFBusImpl.setExtension(CXFBusImpl.java:173)
    at org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener.getService(WSDiscoveryServerListener.java:59)
    at org.apache.cxf.ws.discovery.listeners.WSDiscoveryServerListener.startServer(WSDiscoveryServerListener.java:73)
    at org.apache.cxf.bus.managers.ServerLifeCycleManagerImpl.startServer(ServerLifeCycleManagerImpl.java:61)
    at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:146)
    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:360)
    ... 65 more

我是 CXF 和 Spring 的新手。谁能帮我修复错误?我正在使用 CXF 2.7.5 和 JRE 7。谢谢

4

1 回答 1

0

我需要使用 Cxf 2.6.8 而不是 Cxf 2.7.5。我的版本是 JDK 6、Tomcat 7、Cxf 2.6.8

于 2013-05-31T08:46:20.463 回答