spring整合swagger报错NoSuchMethodError: org.springframework.web.util.UriComponentsBuilder.fromHttpRequest


@参考博客

java.lang.NoSuchMethodError: org.springframework.web.util.UriComponentsBuilder.fromHttpRequest(Lorg/springframework/http/HttpRequest;)Lorg/springframework/web/util/UriComponentsBuilder;
at springfox.documentation.swagger2.web.HostNamePr

原因:原因是spring-web版本不配对swagger2,UriComponentsBuilder内部方法找不到

解决办法:io.springfox俩个包若是2.7.0的版本,spring-web包的版本至少要4.1.6。搭配使用,要么spring整体升级版本,要么swagger降版本。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM