- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 spring-boot 2.1.6.RELEASE
以及 springfox-swagger2
版本 3.0.0-SNAPSHOT
。但无法启动 swagger-ui (即 http://localhost:808/swagger-ui.html )或 api-docs (即 http://localhost:8080/v2/api-docs )url。
相同的配置适用于 springfox-swagger2 版本 2.9.2
。唯一的区别是添加了 @EnableSwagger2WebMvc
和 3.0.0-SNAPSHOT
。
错误详细信息
这是我的pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
<relativePath />
<!-- lookup parent from service -->
</parent>
<groupId>com.mytrainst.train</groupId>
<artifactId>mytransit</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>mytransit</name>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>spring-mock-mvc</artifactId>
<version>3.3.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>jcenter-snapshots</id>
<name>jcenter</name>
<url>http://oss.jfrog.org/artifactory/oss-snapshot-local/</url>
</repository>
</repositories>
</project>
这是Swagger 配置
package com.mytrainst.train.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
@Configuration
@EnableSwagger2WebMvc
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build()
.pathMapping("/");
}
}
Controller 界面
package com.mytrainst.train.controller;
import com.mytrainst.train.domain.Train;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/trains", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public interface ITrainController {
@GetMapping("/name/{name}")
Train findByName(@PathVariable final String name);
}
Controller 实现
package com.mytrainst.train.controller;
import com.mytrainst.train.domain.Train;
import com.mytrainst.train.service.ITrainService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
@Component
@AllArgsConstructor(onConstructor = @__(@Autowired))
@Slf4j
public class TrainController implements ITrainController {
private ITrainService trainService;
@Override
public Train findByName(@PathVariable final String name) {
log.info(":: Request received: {} ", name);
return trainService.findByName(name);
}
}
Spring Boot应用
package com.mytrainst.train;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
以及带有 TRACE
的 springwebframework 日志
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.6.RELEASE)
11:31:36.785 [main] DEBUG o.s.w.c.ContextLoader - Published root WebApplicationContext as ServletContext attribute with name [org.springframework.web.context.WebApplicationContext.ROOT]
11:31:36.785 [main] INFO o.s.w.c.ContextLoader - Root WebApplicationContext: initialization completed in 1235 ms
11:31:38.159 [main] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped [/**/favicon.ico] onto ResourceHttpRequestHandler [class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/], ServletContext resource [/], class path resource []]
11:31:38.159 [main] DEBUG o.s.w.s.h.SimpleUrlHandlerMapping - Patterns [/**/favicon.ico] in 'faviconHandlerMapping'
11:31:38.269 [main] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerAdapter - ControllerAdvice beans: 0 @ModelAttribute, 0 @InitBinder, 1 RequestBodyAdvice, 1 ResponseBodyAdvice
11:31:38.300 [main] TRACE o.s.w.s.m.m.a.RequestMappingHandlerMapping -
c.m.t.c.TrainController:
{GET /trains/name/{name}, produces [application/json;charset=UTF-8]}: findByName(String)
11:31:38.315 [main] TRACE o.s.w.s.m.m.a.RequestMappingHandlerMapping -
o.s.b.a.w.s.e.BasicErrorController:
{ /error}: error(HttpServletRequest)
{ /error, produces [text/html]}: errorHtml(HttpServletRequest,HttpServletResponse)
11:31:38.315 [main] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - 3 mappings in 'requestMappingHandlerMapping'
11:31:38.315 [main] DEBUG o.s.w.s.h.BeanNameUrlHandlerMapping - Detected 0 mappings in 'beanNameHandlerMapping'
11:31:38.315 [main] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped [/webjars/**] onto ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"]
11:31:38.315 [main] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped [/**] onto ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"]
11:31:38.315 [main] DEBUG o.s.w.s.h.SimpleUrlHandlerMapping - Patterns [/webjars/**, /**] in 'resourceHandlerMapping'
11:31:38.331 [main] DEBUG o.s.w.s.m.m.a.ExceptionHandlerExceptionResolver - ControllerAdvice beans: 0 @ExceptionHandler, 1 ResponseBodyAdvice
11:31:47.329 [http-nio-8080-exec-1] INFO o.s.w.s.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
11:31:47.329 [http-nio-8080-exec-1] TRACE o.s.w.s.DispatcherServlet - Detected org.springframework.web.multipart.support.StandardServletMultipartResolver@4837f97e
11:31:47.329 [http-nio-8080-exec-1] TRACE o.s.w.s.DispatcherServlet - No LocaleResolver 'localeResolver': using default [AcceptHeaderLocaleResolver]
11:31:47.345 [http-nio-8080-exec-1] TRACE o.s.w.s.DispatcherServlet - No ThemeResolver 'themeResolver': using default [FixedThemeResolver]
11:31:47.345 [http-nio-8080-exec-1] TRACE o.s.w.s.DispatcherServlet - No RequestToViewNameTranslator 'viewNameTranslator': using default [DefaultRequestToViewNameTranslator]
11:31:47.345 [http-nio-8080-exec-1] TRACE o.s.w.s.DispatcherServlet - No FlashMapManager 'flashMapManager': using default [SessionFlashMapManager]
11:31:47.345 [http-nio-8080-exec-1] DEBUG o.s.w.s.DispatcherServlet - enableLoggingRequestDetails='false': request parameters and headers will be masked to prevent unsafe logging of potentially sensitive data
11:31:47.345 [http-nio-8080-exec-1] INFO o.s.w.s.DispatcherServlet - Completed initialization in 16 ms
11:31:47.345 [http-nio-8080-exec-1] TRACE o.s.w.s.DispatcherServlet - GET "/swagger-ui.html", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
11:31:47.360 [http-nio-8080-exec-1] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"]] and 4 interceptors
11:31:47.376 [http-nio-8080-exec-1] TRACE o.s.w.s.DispatcherServlet - No view rendering, null ModelAndView returned.
11:31:47.376 [http-nio-8080-exec-1] DEBUG o.s.w.s.DispatcherServlet - Completed 200 OK, headers={masked}
11:31:47.454 [http-nio-8080-exec-2] TRACE o.s.w.s.DispatcherServlet - GET "/webjars/springfox-swagger-ui/springfox.css?v=3.0.0-SNAPSHOT", parameters={masked}, headers={masked} in DispatcherServlet 'dispatcherServlet'
11:31:47.454 [http-nio-8080-exec-2] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Matching patterns [/webjars/**, /**]
11:31:47.454 [http-nio-8080-exec-3] TRACE o.s.w.s.DispatcherServlet - GET "/webjars/springfox-swagger-ui/swagger-ui.css?v=3.0.0-SNAPSHOT", parameters={masked}, headers={masked} in DispatcherServlet 'dispatcherServlet'
11:31:47.454 [http-nio-8080-exec-2] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"]] and 4 interceptors
11:31:47.454 [http-nio-8080-exec-5] TRACE o.s.w.s.DispatcherServlet - GET "/webjars/springfox-swagger-ui/swagger-ui-standalone-preset.js?v=3.0.0-SNAPSHOT", parameters={masked}, headers={masked} in DispatcherServlet 'dispatcherServlet'
11:31:47.454 [http-nio-8080-exec-4] TRACE o.s.w.s.DispatcherServlet - GET "/webjars/springfox-swagger-ui/swagger-ui-bundle.js?v=3.0.0-SNAPSHOT", parameters={masked}, headers={masked} in DispatcherServlet 'dispatcherServlet'
11:31:47.454 [http-nio-8080-exec-6] TRACE o.s.w.s.DispatcherServlet - GET "/webjars/springfox-swagger-ui/springfox.js?v=3.0.0-SNAPSHOT", parameters={masked}, headers={masked} in DispatcherServlet 'dispatcherServlet'
11:31:47.454 [http-nio-8080-exec-3] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Matching patterns [/webjars/**, /**]
11:31:47.454 [http-nio-8080-exec-3] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"]] and 4 interceptors
11:31:47.454 [http-nio-8080-exec-4] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Matching patterns [/webjars/**, /**]
11:31:47.454 [http-nio-8080-exec-6] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Matching patterns [/webjars/**, /**]
11:31:47.454 [http-nio-8080-exec-5] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Matching patterns [/webjars/**, /**]
11:31:47.454 [http-nio-8080-exec-4] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"]] and 4 interceptors
11:31:47.454 [http-nio-8080-exec-6] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"]] and 4 interceptors
11:31:47.454 [http-nio-8080-exec-5] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"]] and 4 interceptors
11:31:47.469 [http-nio-8080-exec-2] TRACE o.s.w.s.DispatcherServlet - No view rendering, null ModelAndView returned.
11:31:47.469 [http-nio-8080-exec-2] DEBUG o.s.w.s.DispatcherServlet - Completed 200 OK, headers={masked}
11:31:47.469 [http-nio-8080-exec-6] TRACE o.s.w.s.DispatcherServlet - No view rendering, null ModelAndView returned.
11:31:47.469 [http-nio-8080-exec-6] DEBUG o.s.w.s.DispatcherServlet - Completed 200 OK, headers={masked}
11:31:47.469 [http-nio-8080-exec-3] TRACE o.s.w.s.DispatcherServlet - No view rendering, null ModelAndView returned.
11:31:47.469 [http-nio-8080-exec-3] DEBUG o.s.w.s.DispatcherServlet - Completed 200 OK, headers={masked}
11:31:47.469 [http-nio-8080-exec-5] TRACE o.s.w.s.DispatcherServlet - No view rendering, null ModelAndView returned.
11:31:47.485 [http-nio-8080-exec-5] DEBUG o.s.w.s.DispatcherServlet - Completed 200 OK, headers={masked}
11:31:47.501 [http-nio-8080-exec-4] TRACE o.s.w.s.DispatcherServlet - No view rendering, null ModelAndView returned.
11:31:47.501 [http-nio-8080-exec-4] DEBUG o.s.w.s.DispatcherServlet - Completed 200 OK, headers={masked}
11:31:47.719 [http-nio-8080-exec-7] TRACE o.s.w.s.DispatcherServlet - GET "/swagger-resources/configuration/ui", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
11:31:47.719 [http-nio-8080-exec-7] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"]] and 4 interceptors
11:31:47.719 [http-nio-8080-exec-7] DEBUG o.s.w.s.r.ResourceHttpRequestHandler - Resource not found
11:31:47.719 [http-nio-8080-exec-7] TRACE o.s.w.s.DispatcherServlet - No view rendering, null ModelAndView returned.
11:31:47.719 [http-nio-8080-exec-7] DEBUG o.s.w.s.DispatcherServlet - Completed 404 NOT_FOUND, headers={}
11:31:47.735 [http-nio-8080-exec-7] TRACE o.s.w.s.DispatcherServlet - "ERROR" dispatch for GET "/error", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
11:31:47.735 [http-nio-8080-exec-7] TRACE o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped to public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
11:31:47.735 [http-nio-8080-exec-7] TRACE o.s.w.s.m.m.a.ServletInvocableHandlerMethod - Arguments: [org.apache.catalina.core.ApplicationHttpRequest@6c5d58b]
11:31:47.751 [http-nio-8080-exec-7] DEBUG o.s.w.s.m.m.a.HttpEntityMethodProcessor - Using 'application/json', given [application/json] and supported [application/json, application/*+json, application/json, application/*+json]
11:31:47.751 [http-nio-8080-exec-7] TRACE o.s.w.s.m.m.a.HttpEntityMethodProcessor - Writing [{timestamp=Thu Jul 04 11:31:47 EDT 2019, status=404, error=Not Found, message=No message available, path=/swagger-resources/configuration/ui}]
11:31:47.782 [http-nio-8080-exec-7] TRACE o.s.w.s.DispatcherServlet - No view rendering, null ModelAndView returned.
11:31:47.782 [http-nio-8080-exec-7] DEBUG o.s.w.s.DispatcherServlet - Exiting from "ERROR" dispatch, status 404, headers={masked}
11:31:47.782 [http-nio-8080-exec-8] TRACE o.s.w.s.DispatcherServlet - GET "/webjars/springfox-swagger-ui/favicon-32x32.png?v=3.0.0-SNAPSHOT", parameters={masked}, headers={masked} in DispatcherServlet 'dispatcherServlet'
11:31:47.782 [http-nio-8080-exec-8] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Matching patterns [/webjars/**, /**]
11:31:47.782 [http-nio-8080-exec-8] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/webjars/"]] and 4 interceptors
11:31:47.782 [http-nio-8080-exec-8] TRACE o.s.w.s.DispatcherServlet - No view rendering, null ModelAndView returned.
11:31:47.782 [http-nio-8080-exec-8] DEBUG o.s.w.s.DispatcherServlet - Completed 200 OK, headers={masked}
11:31:47.798 [http-nio-8080-exec-9] TRACE o.s.w.s.DispatcherServlet - GET "/swagger-resources/configuration/security", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
11:31:47.798 [http-nio-8080-exec-9] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"]] and 4 interceptors
11:31:47.798 [http-nio-8080-exec-9] DEBUG o.s.w.s.r.ResourceHttpRequestHandler - Resource not found
11:31:47.798 [http-nio-8080-exec-9] TRACE o.s.w.s.DispatcherServlet - No view rendering, null ModelAndView returned.
11:31:47.798 [http-nio-8080-exec-9] DEBUG o.s.w.s.DispatcherServlet - Completed 404 NOT_FOUND, headers={}
11:31:47.798 [http-nio-8080-exec-9] TRACE o.s.w.s.DispatcherServlet - "ERROR" dispatch for GET "/error", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
11:31:47.798 [http-nio-8080-exec-9] TRACE o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped to public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
11:31:47.798 [http-nio-8080-exec-9] TRACE o.s.w.s.m.m.a.ServletInvocableHandlerMethod - Arguments: [org.apache.catalina.core.ApplicationHttpRequest@21a5053e]
11:31:47.798 [http-nio-8080-exec-9] DEBUG o.s.w.s.m.m.a.HttpEntityMethodProcessor - Using 'application/json', given [application/json] and supported [application/json, application/*+json, application/json, application/*+json]
11:31:47.798 [http-nio-8080-exec-9] TRACE o.s.w.s.m.m.a.HttpEntityMethodProcessor - Writing [{timestamp=Thu Jul 04 11:31:47 EDT 2019, status=404, error=Not Found, message=No message available, path=/swagger-resources/configuration/security}]
11:31:47.798 [http-nio-8080-exec-9] TRACE o.s.w.s.DispatcherServlet - No view rendering, null ModelAndView returned.
11:31:47.798 [http-nio-8080-exec-9] DEBUG o.s.w.s.DispatcherServlet - Exiting from "ERROR" dispatch, status 404, headers={masked}
11:31:47.813 [http-nio-8080-exec-10] TRACE o.s.w.s.DispatcherServlet - GET "/swagger-resources", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
11:31:47.813 [http-nio-8080-exec-10] TRACE o.s.w.s.h.SimpleUrlHandlerMapping - Mapped to HandlerExecutionChain with [ResourceHttpRequestHandler ["classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/", "/"]] and 4 interceptors
11:31:47.813 [http-nio-8080-exec-10] DEBUG o.s.w.s.r.ResourceHttpRequestHandler - Resource not found
11:31:47.813 [http-nio-8080-exec-10] TRACE o.s.w.s.DispatcherServlet - No view rendering, null ModelAndView returned.
11:31:47.813 [http-nio-8080-exec-10] DEBUG o.s.w.s.DispatcherServlet - Completed 404 NOT_FOUND, headers={}
11:31:47.813 [http-nio-8080-exec-10] TRACE o.s.w.s.DispatcherServlet - "ERROR" dispatch for GET "/error", parameters={}, headers={masked} in DispatcherServlet 'dispatcherServlet'
11:31:47.813 [http-nio-8080-exec-10] TRACE o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped to public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
11:31:47.813 [http-nio-8080-exec-10] TRACE o.s.w.s.m.m.a.ServletInvocableHandlerMethod - Arguments: [org.apache.catalina.core.ApplicationHttpRequest@2e4ca218]
11:31:47.813 [http-nio-8080-exec-10] DEBUG o.s.w.s.m.m.a.HttpEntityMethodProcessor - Using 'application/json', given [application/json] and supported [application/json, application/*+json, application/json, application/*+json]
11:31:47.813 [http-nio-8080-exec-10] TRACE o.s.w.s.m.m.a.HttpEntityMethodProcessor - Writing [{timestamp=Thu Jul 04 11:31:47 EDT 2019, status=404, error=Not Found, message=No message available, path=/swagger-resources}]
11:31:47.813 [http-nio-8080-exec-10] TRACE o.s.w.s.DispatcherServlet - No view rendering, null ModelAndView returned.
11:31:47.813 [http-nio-8080-exec-10] DEBUG o.s.w.s.DispatcherServlet - Exiting from "ERROR" dispatch, status 404, headers={masked}
我不确定在使用 springfox-swagger2 版本 3.0.0-SNAPSHOT 时缺少什么。我根本没有启用任何安全性。我想使用普通的 spring-web 和 swagger。非常感谢任何解决此问题的指示。
最佳答案
将缺少的依赖项添加到 pom.xml
后问题已解决
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-spring-webmvc</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
关于java - 使用 springfox-swagger2 版本 3.0.0-SNAPSHOT 观察错误 "Unable to infer base url",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56891417/
无法使用 Hive 版本 1.1.0 HBase 版本 0.94.8 和 hadoop 版本 2.7.0 从 hive 创建 Hbase 表 hive (default)> CREATE TABLE
我试图为 electron app 创建可执行文件但面临这个问题 Unable to determine Electron version. Please specify an Electron ve
我正在尝试让自适应阈值在 python 绑定(bind)到 opencv 中工作(swig 一个 - 无法让 opencv 2.0 工作,因为我正在使用 beagleboard 因为交叉编译还没有工作
我一直在 linux 机器上使用 JMeter,在命令行下使用了一段时间。工作正常。 今天,我在 Windows 机器(新客户端等)上尝试了它,它确实可以工作,但在控制台窗口中输出有很大不同。 Lin
在我的编码环境中,我通常使用最新版本的 Java 和 Eclipse。当我编写源代码时,我不会注意我使用的 API 方法或类是否向后兼容旧版本的 Java 或 Eclipse。在 javadoc 中存
问题是关于版本的特定组合,但更普遍。 我刚刚从 Kubuntu 12.04 升级到 14.04。现在,当我想编译 CUDA 代码(使用 CUDA 6.5)时,我得到: #error -- unsupp
我目前正在对我的一些应用程序进行沙箱处理,看来我必须删除一些功能才能满足 Mac App Store 沙箱(和其他)规则。 显然用户不会因为失去功能而感到高兴,我担心他们不会指责苹果制定了愚蠢的规则,
我用 flash 和 js 版本创建了一个动画横幅。 是否可以检测低于版本 9 的 ie 版本,然后提供 Flash 横幅,否则提供 js 横幅。 最佳答案 您可以使用条件注释来检测 IE 版本
我有一个处理不同位置的数据库的应用程序,我想检查这些数据库是否使用 Firebird 2.5 或更高版本打开。我们最近从 Firebird 2.0 迁移到了 2.5,我们有很多数据库可以响应 sele
我正在开发一个应用程序,我使用托管在我的服务器上的 Java 和 Jersey 构建了后端部分。我在服务器上使用 Tomcat7 来调用 Web 服务。 我以前有一台安装了 Ubuntu 的计算机,我
我可以使用 GetVersionEx() 函数来获取 Windows 版本,但是这个函数将返回一个数字而不是一个字符串。但是没有问题,因为我可以将数字转换为字符串,例如: if (osvi.dwMaj
我已经在我的系统中安装了 Anaconda 2 & 3。 Anaconda 2 包含 python 2.7 & Anaconda 3 包含 python 3.6。 我需要使用命令提示符运行我的 pyt
我正在尝试构建一个 Android 项目,但发生了以下错误 Error:(10, 1) A problem occurred evaluating project ':app'. > Failed t
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 4 年前。 Improve this qu
在降级我的 GCC 之前,我想知道是否有办法确定我的机器中的哪些程序/框架或依赖项会中断,以及是否有更好的方法来执行 openpose 安装? (例如,在 CMake 中更改某些内容) 有没有办法在不
我已经在终端的代码sudo apt-get install Shadowsocks-qt5中安装了Shadowsocks-Qt5,然后我可以通过搜索找到启动图标,但是它当我点击图标时打不开。然后我尝试
在网络上找到的文档说,MLLP V2(第 2 版)是用于传输 HL7 版本 3 内容的所有消息传输协议(protocol)的要求。似乎 MLLP 第 2 版主要用于 HL7 第 3 版。 我们可以/应
我正在使用带有 selinium webdriver 的 Protractor 。我的chromeDriver版本是78.0.1,chrome版本是78.0.3904.97。两个版本都匹配,应该不会有
我正在按照教程设置 mysql 数据库并做一些事情。我无法找到数据库资源管理器。我读了很多,但在 Window->show View-> Dataxxx 或右侧上部选项卡中无法正常工作。 最佳答案 从
我已经在 KDE 桌面上安装了 Anaconda 2.0.1。当我运行 python 并看到所有已安装的模块时,我收到此消息“无法将不兼容的 Qt 库(版本 0x40801)与该库(版本 0x4080
我是一名优秀的程序员,十分优秀!