我正在将一个使用Spring security 3.0的应用程序迁移到Spring security 3.1。
我一直收到关于被引用的架构不正确的错误:
SEVERE: Exception sending context initialized event to listener instance of class
org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration
problem: You must use a 3.0 schema with Spring Security 3.0.(2.0 or 3.1 versions are not
valid) Please update your schema declarations to the 3.0.3 schema (spring-security-
3.0.3.xsd).
Offending resource: ServletContext resource [/WEB-INF/security-context.xml]当我查看/lib时,我看到许多3.1版本的jars被复制为3.0版本。我怀疑这就是导致上述错误的原因。
当我使用Eclipse Maven插件查看pom.xml的依赖关系树时,我可以看到引用了早期版本的地方(例如spring-security-acl依赖于几个3.0jar),但它们被标记为“由于与...冲突而被省略”。这是否意味着应该从构建的war文件中省略它们?
我尝试在我的pom根目录中显式地命名这些文件的3.1版本,但仍然包含较旧的版本。
发布于 2012-07-23 21:14:05
我仍然不确定发生了什么,但我尝试使用相同的pom和源文件在Eclipse中创建一个新项目,现在该项目似乎可以正常运行了。
发布于 2012-07-19 13:24:39
安全违规资源: ServletContext资源/WEB-INF/
-context.xml
实际上,该消息表明security-context.xml使用的模式/声明与spring-security-3.1不兼容。该消息要求您改用该库的3.0版本。您可能需要检查并更新它,然后重试。
https://stackoverflow.com/questions/11552724
复制相似问题