Spring boot swagger2 404

喜夏-厌秋 提交于 2019-12-13 02:47:19

问题


I am converting an older java 6 SOAP project to java 8 with spring boot and swagger. I used to be able to use swagger before autowiring a service but now I get a white page in browser with errors rapidly appearing in the console of chrome.

pom.xml

<dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>2.8.0</version>
    </dependency>
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>2.8.0</version>
    </dependency>

application.yaml

server:
port: 30001

In the url there is localhost/null/swagger so I assume the problem is there somewhere, I changed the context to test and then the error was localhost/test/null/swagger..

@SpringBootApplication(scanBasePackages = {
        "com.company.location.myprogram"
})
public class WebserviceApplication {

来源:https://stackoverflow.com/questions/50151638/spring-boot-swagger2-404

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!