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

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/*

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥15 复杂网络,变滞后传递熵,FDA
  • ¥20 csv格式数据集预处理及模型选择
  • ¥15 部分网页页面无法显示!
  • ¥15 怎样解决power bi 中设置管理聚合,详细信息表和详细信息列显示灰色,而不能选择相应的内容呢?
  • ¥15 QTOF MSE数据分析
  • ¥15 平板录音机录音问题解决