0

我正在尝试在 Spring 3.1.2 项目中使用 swagger-springmvc 0.6.6。但是当我将应用程序部署到 Tomcat 时,它失败并出现异常。

我使用的版本似乎有问题。swagger-springmvc 还引入了与 Spring 3.1.2 jar 冲突的 Spring 3.2.4 jar。

错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'org.springframework.security.filterChains': Cannot resolve reference to bean
'org.springframework.security.web.DefaultSecurityFilterChain#2'
while setting bean property 'sourceList' with key [2]; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'org.springframework.security.web.DefaultSecurityFilterChain#2
.......

....nested exception is java.lang.ClassNotFoundException:
org.springframework.cache.ehcache.EhCacheFactoryBean

该类org.springframework.cache.ehcache.EhCacheFactoryBean在 Spring 3.1.2 和 Spring 3.2.4 中都可以找到。

当我尝试在我的本地 smachine 中运行该应用程序时,它的运行没有问题。

有人可以帮我解决这个问题吗?

4

1 回答 1

1

请参考此示例配置。这是一个非常简单的普通设置,显示了所需的最低配置。

JDK 6 Tomcat 7 春季 3.2.4

https://github.com/varoonverma/Swagger.git

干杯,

于 2014-04-14T12:45:03.960 回答