Maven spring依赖问题

时间:2017-03-31 15:43:50

标签: java maven spring-boot dependency-injection pom.xml

我在我的应用程序中添加了一个基于springboot的组件的依赖项,我在尝试在我的应用程序启动时进行部署时遇到此异常,我尝试添加的dependendy是构建在spring上的内部组件,我们确实有基于spring的其他依赖项对其他组件

父POM

<vehicle.client.version>19</vehicle.client.version>

Sub POM

  <dependency>
                <groupId>x</groupId>
                <artifactId>vehicleclient-impl-jms</artifactId>
                <version>${vehicle.client.version}</version>
            </dependency>

栈跟踪

[org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext] | Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined in URL [jar:file:ct-gw-gateway-deployable/0-SNAPSHOT/runtime/jar/application/ct-gw-gateway-app-0-SNAPSHOT.war!/WEB-INF/lib/springfox-spring-web-2.6.1.jar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:/opt/gw/ct-gw-gateway-deployable/0-SNAPSHOT/runtime/jar/application/ct-gw-gateway-app-0-SNAPSHOT.war!/WEB-INF/lib/springfox-spring-web-2.6.1.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in com.wirelesscar.componentbase.web.EnablegwWebMvcConfiguration: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'swagger2ProxySupportController' method
    public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> com.wirelesscar.componentbase.apidocumentation.swagger.Swagger2ProxySupportController.getDocumentation2(java.lang.String,javax.servlet.http.HttpServletRequest)
    to {[/support-tool-support/api-docs],methods=[GET]}: There is already 'swagger2SupportToolSupportController' bean method
    public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> com.wirelesscar.componentbase.apidocumentation.swagger.Swagger2SupportToolSupportController.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest) mapped.
    2017-03-31 13:40:53.710 [E] [                                ] [org.springframework.boot.SpringApplication] | Application startup failed
    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'documentationPluginsBootstrapper' defined in URL [jar:file:/opt/gw/ct-gw-gateway-deployable/0-SNAPSHOT/runtime/jar/application/ct-gw-gateway-app-0-SNAPSHOT.war!/WEB-INF/lib/springfox-spring-web-2.6.1.jar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webMvcRequestHandlerProvider' defined in URL [jar:file:/opt/gw/ct-gw-gateway-deployable/0-SNAPSHOT/runtime/jar/application/ct-gw-gateway-app-0-SNAPSHOT.war!/WEB-INF/lib/springfox-spring-web-2.6.1.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in com.wirelesscar.componentbase.web.EnablegwWebMvcConfiguration: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'swagger2ProxySupportController' method
    public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> com.wirelesscar.componentbase.apidocumentation.swagger.Swagger2ProxySupportController.getDocumentation2(java.lang.String,javax.servlet.http.HttpServletRequest)
    to {[/support-tool-support/api-docs],methods=[GET]}: There is already 'swagger2SupportToolSupportController' bean method
    public org.springframework.http.ResponseEntity<springfox.documentation.spring.web.json.Json> com.wirelesscar.componentbase.apidocumentation.swagger.Swagger2SupportToolSupportController.getDocumentation(java.lang.String,javax.servlet.http.HttpServletRequest) mapped.
            at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749) ~[spring-beans-4.3.4.RELEASE.jar!/:4.3.4.RELEASE]

0 个答案:

没有答案