cxf2.7.10与Spring3.0.5集成时报错如下

严重: Error listenerStart

2014-3-29 22:25:20 org.apache.catalina.core.StandardContext start

严重: Context [/cxfspring] startup failed due to previous errors

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)

    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:276)

    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)

    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)

    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)

    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)

    at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3460)

    at org.apache.catalina.manager.ManagerServlet.reload(ManagerServlet.java:943)

    at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:361)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

    at java.lang.Thread.run(Thread.java:619)

Caused by: javax.xml.ws.WebServiceException: java.lang.RuntimeException: No ASM ClassWriterFound

    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:371)

    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)

    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:539)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1544)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)

    ... 32 more

Caused by: java.lang.RuntimeException: No ASM ClassWriterFound

    at org.apache.cxf.common.util.ASMHelper.createClassWriter(ASMHelper.java:269)

    at org.apache.cxf.jaxws.WrapperClassGenerator.createWrapperClass(WrapperClassGenerator.java:151)

    at org.apache.cxf.jaxws.WrapperClassGenerator.generate(WrapperClassGenerator.java:122)

    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.generatedWrapperBeanClass(JaxWsServiceFactoryBean.java:683)

    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.getExtraClass(JaxWsServiceFactoryBean.java:653)

    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:484)

    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:704)

    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:550)

    at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265)

    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215)

    at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)

    at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:159)

    at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)

    at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:456)

    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:334)

    ... 41 more

Caused by: java.lang.NoClassDefFoundError: org/objectweb/asm/ClassWriter

    at org.apache.cxf.common.util.ASMHelper.getASMClassWriterClass(ASMHelper.java:86)

    at org.apache.cxf.common.util.ASMHelper.getASMClass(ASMHelper.java:97)

    at org.apache.cxf.common.util.ASMHelper.createClassWriter(ASMHelper.java:266)

    ... 55 more

Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassWriter

    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)

    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)

    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

    ... 58 more

此异常是在使用@WebService注解之后出现的,解决方法,将apache-cxf-2.7.10/lib/下面的asm-3.3.1.jar

包导入。

你可能感兴趣的:(Spring3)