【发布时间】:2017-06-21 07:34:38
【问题描述】:
我当前的项目是基于 Spring 3.0.6.RELEASE (Spring rest) 的 maven,我正在尝试将 swagger 与我的项目集成,但我遇到了依赖问题,也没有从 swagger 网站上找到足够的文档。
我在 pom.xml 文件中使用了以下依赖项。
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>com.mangofactory</groupId>
<artifactId>swagger-springmvc</artifactId>
<version>0.5.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>[${jackson.databind-version}]</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>[${jackson.databind-version}]</version>
</dependency>
您能否请人帮忙找到与 Spring 3.0.6.RELEASE 集成的正确依赖项,因为在将战争部署到服务器时低于异常。
org.apache.catalina.core.StandardContext listenerStart SEVERE:
Exception sending context initialized event to listener instance of class
org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'documentationController': Injection of
autowired dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not
autowire field: private
SEVERE: Context initialization failedjava.lang.NoClassDefFoundError:
org/springframework/web/bind/support/WebDataBinderFactory at
java.lang.Class.getDeclaredMethods0(Native Method) at
java.lang.Class.privateGetDeclaredMethods(Unknown Source) at
java.lang.Class.getDeclaredMethods(Unknown Source) at
org.springframework.core.type.StandardAnnotationMetadata.has
AnnotatedMethods(StandardAnnotationMetadata.java:136)
注意:我们有很好的 spring 4.X 版本的文档,但 Spring 3.0.6 版本没有。
【问题讨论】:
-
你遇到了什么问题??
-
请更新您的问题并在此处添加完整的异常堆栈跟踪并删除上述 cmets..
-
嗨,凯,更新了有例外的问题,请检查。
标签: spring maven swagger swagger-ui spring-rest