完整错误为

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-07-11 15:37:56.786 ERROR 3176 --- [  restartedMain] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method errorPageCustomizer in org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration required a bean of type 'org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath' that could not be found.

Action:

Consider defining a bean of type 'org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath' in your configuration.

进程已结束,退出代码为 0

org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath' that could not be found.中可以看出找不到这个方法

代码为:

package com.rc.demo.config;// ~ File Informationimport com.rc.demo.webservice.HelloWordImpl;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.SpringBus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.transport.servlet.CXFServlet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;import javax.xml.ws.Endpoint;/*** 类说明:webservice发布,默认访问地址为:localhost:8080/services/helloWord?wsdl*/
@Configuration
public class WebServiceConfig {// ~ Fields@Autowiredprivate HelloWordImpl helloWord;//接口实现类// ~ Methods/*** 此方法作用是改变项目中服务名的前缀名,此处127.0.0.1或者localhost不能访问时,请使用ipconfig查看本机ip来访问* 此方法被注释后:wsdl访问地址为http://127.0.0.1:8080/services/user?wsdl* 去掉注释后:wsdl访问地址为:http://127.0.0.1:8080/soap/user?wsdl* @return*/@SuppressWarnings("all")@Beanpublic ServletRegistrationBean dispatcherServlet() {return new ServletRegistrationBean(new CXFServlet(), "/soap/*");}@Bean(name = Bus.DEFAULT_BUS_ID)public SpringBus springBus() {return new SpringBus();}@Beanpublic Endpoint endpoint() {EndpointImpl endpoint=new EndpointImpl(springBus(), helloWord);endpoint.publish("/helloWord");//访问地址System.out.println("----------------helloWorlWebservice接口启动成功");return endpoint;}}

我们给

public ServletRegistrationBean dispatcherServlet() {

return new ServletRegistrationBean(new CXFServlet(), "/soap/*");

}

方法名dispathcerServlet改成其他名字就好比如说

public ServletRegistrationBean dispatcherServlet1() {

return new ServletRegistrationBean(new CXFServlet(), "/soap/*");

}

就可以了

Springboot创建webService接口时的cxfconfi文件报错出现DispatcherServletPath不能找到相关推荐

  1. oracle外部表kup-04040,【故障处理】19c PDB中创建外部表时,出现KUP-04040报错

    [故障描述] 使用网络连接的方式登录19c的PDB,然后创建oracle_loader驱动模式的外部表.创建成功后,在检索数据时,出现KUP-04040的报错,过程如下: [oracle@sdedu ...

  2. 关于访问接口时前后端都报错:404 (Not Found)

    最近尝试写一个项目,采用node模拟后端,在调用接口获取数据时发现前后端都提示404,进行排查后发现是自己书写错误,特此记录一下. 请求代码: 前端提示: ​​​​​​​ 后端提示: ​​​​​​​  ...

  3. 如何解决“Linux解压zip文件报错‘-bash: unzip: 未找到命令’”?

    一.报错:  二.问题原因: 没有安装zip 没有安装unzip 三. 解决方法: 1.安装zip yum install zip 2.安装unzip yum install unzip  再试一下:

  4. pom文件报错,错误如下:(org.apache.maven.project.MavenProject,org.apache.maven.archiver.MavenArchiveConfigurat

    导入新项目时,pom文件报错,错误如下: org.apache.maven.archiver.MavenArchiver.getManifest (org.apache.maven.project.M ...

  5. jmeter web服务器协议,【JMeter4.0学习(三)】之SoapUI创建WebService接口模拟服务端以及JMeter测试SOAP协议性能测试脚本开发(示例代码)...

    目录: [阐述]:首先应该遇到了一个共同的问题,JMeter3.2之后就没有WebService(SOAP) Request,后来经过查询网上资料得知其实可以用HTTP请求来操作,结果是一样的. [步 ...

  6. SharePoint 2013创建应用程序时IIS端口文件夹下没文件

    最近SharePoint 2007迁移到2013的时候,碰到创建应用程序时IIS端口文件夹下没文件的问题,网上找了大把的原因,终于在这里找到了解决方案: Fix: 1. Open IIS on the ...

  7. 创建用户注册接口时的两个小问题

    今天在创建用户注册接口时,出现了两个小问题:①利用遍历对象的方法判断接收的数据是否为空:②判断用户名是否已经存在.经过反复尝试后,最终找到了解决方法,现在分享给大家! 一.遍历对象的方法判断请求的到的 ...

  8. linux系统读取excel文件是否存在,小弟我用poi读excel,在window下没有有关问题,但把程序放到linux上时,读取客户端的excel文件报错,不...

    我用poi读excel,在window下没有问题,但把程序放到linux上时,读取客户端的excel文件报错,不知道如何解决 我用poi读excel,在window下没有问题,但把程序放到linux上 ...

  9. springboot配置日志文件报错:

    前言 springboot配置日志文件报错: 错误信息如下: ERROR in ch.qos.logback.core.joran.spi.Interpreter@3:65 - no applicab ...

  10. spring-boot整合smart-doc推送接口文档到torna报错Failure to find xxx... resolution will not be reattempted until

    spring-boot整合smart-doc推送接口文档到torna报错Failure to find xxx- resolution will not be reattempted until th ...

最新文章

  1. mybatis简化实现思路
  2. SpringBoot学习平台
  3. java 实现违章_基于JAVA的车辆违章查询数据调用代码实例
  4. CF797E. Array Queries
  5. Android L 仍需改善的三个问题
  6. H5新增的标签以及属性
  7. js 中动态添加成员对象与数组或map转换(成员字段含有.)
  8. nfc加密卡pm3和pm5区别_小米手环4/5 NFC添加加密门禁
  9. 我今年挣了......
  10. 浅析Vue.js 中的条件渲染指令
  11. 出现这6种评估违法状况,征收补偿决定可能被撤销!
  12. [No0000EB]C# 数组(Array)
  13. python 输出语句
  14. 下载的java游戏怎么运行不了_不支持JAVA的手机如何下载运行游戏和QQ
  15. java网站渗透测试_如何进行Web渗透测试
  16. 毕设-基于JavaWeb体育竞赛管理系统
  17. 用ajax来上传图片,AJAX上传图片,使用ajaxupload
  18. 测试技术-兼容性测试
  19. crystal xcelsius 的使用
  20. 删除磁盘分区 删除OEM分区

热门文章

  1. 将你的掘金小册制作成一整本PDF
  2. oracle12c ora01017,ORACLE 12C 之 ORA-01017
  3. 高通IPQ5018,QSDK V11.5版本手动编译指南-64位
  4. python 编译成exe vmp加密_加密软件VMProtect入门教程
  5. HIL自动驾驶仿真:VTD分布式显示配置详解
  6. html插入cad,如何快速的在CAD中插入数字?
  7. Python用Pyinstaller打包成的exe文件反编译成*.py文件
  8. Activiti 单环节多人办理一件
  9. c语言免疫算法,人工免疫算法的全局收敛性分析
  10. 《战地风云2042》游戏评测,云游戏走起