taopenglove
2016-09-21 09:13
采纳率: 100%
浏览 1.7k
已采纳

spring+spring mvc+cxf启动报错,在jar包中能找到报错的类。

配置文件 cxf-server.xml

<?xml version="1.0" encoding="UTF-8"?>

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">

    <import resource="classpath:META-INF/cxf/cxf.xml" />  
    <!-- <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />  
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> -->  


  <bean id="UserServiceImp" class="com.test.testssm.UserServiceImp"></bean>
  <jaxrs:server id="UserService"  
    address="/userServiceCXF">  
    <jaxrs:serviceBeans>  
        <ref bean="UserServiceImp"/>  
    </jaxrs:serviceBeans>  
    <jaxrs:extensionMappings>  
        <entry key="json" value="application/json"></entry>  
        <entry key="xml" value="application/xml" />  
    </jaxrs:extensionMappings>  
</jaxrs:server>  

九月 21, 2016 5:02:05 下午 org.apache.catalina.core.ApplicationContext log
INFO: Set web app root system property: 'test.root' = [D:\apache-tomcat-7.0.42\webapps\TESTSSM]
九月 21, 2016 5:02:05 下午 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'mvc'
九月 21, 2016 5:02:08 下午 org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet ws as unavailable
九月 21, 2016 5:02:08 下午 org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /TESTSSM threw load() exception
java.lang.ClassNotFoundException: org.apache.cxf.trasport.servlet.CXFServlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:527)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:509)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
九月 21, 2016 5:02:08 下午 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
九月 21, 2016 5:02:08 下午 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
九月 21, 2016 5:02:08 下午 org.apache.catalina.startup.Catalina start
INFO: Server startup in 27404 ms

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

5条回答 默认 最新

  • taopenglove 2016-09-22 03:59
    已采纳

    问题已经解决了。修改方式将web xml中引入cxf的方式进行修改:


    cxfServlet

    org.apache.cxf.transport.servlet.CXFServlet


    config-location

    classpath:cxf-server.xml



    1





    cxfServlet

    /services/*

    点赞 打赏 评论
  • Bug开发攻城狮 2016-09-21 09:21

    是哪个jar包,是cxf-2.6.0.jar?

    点赞 打赏 评论
  • ming_950803 2016-09-21 09:29

    bean标签配置的类能找到吗

    点赞 打赏 评论
  • 一个程序猿子 2016-09-21 09:53

    参考一下图片说明

    点赞 打赏 评论
  • 鲜凯 2016-09-21 10:01

    开发模式中你没有导入这个jar包

    点赞 打赏 评论

相关推荐 更多相似问题