我正在开发一个使用CAS和LDAP的spring安全性的grails应用程序。它的配置记录在案here。当我使用grails run-app
运行时,一切正常,但是当我将WAR部署到tomcat(或调用grails run-war
)时,我得到以下异常:
2013-10-16 11:19:47,658 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: org/springframework/security/core/authority/mapping/GrantedAuthoritiesMapper
java.lang.NoClassDefFoundError: org/springframework/security/core/authority/mapping/GrantedAuthoritiesMapper
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper
... 7 more
2013-10-16 11:19:47,658 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing Grails: org/springframework/security/core/authority/mapping/GrantedAuthoritiesMapper
java.lang.NoClassDefFoundError: org/springframework/security/core/authority/mapping/GrantedAuthoritiesMapper
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getDeclaredMethods(Class.java:1791)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: org.springframework.security.core.authority.mapping.GrantedAuthoritiesMapper
... 7 more
这曾经在Tomcat上工作,直到我添加了一些具有spring-security-core 3.1.4
传递依赖的依赖项。我不得不排除那些传递依赖项以使其运行(使用grails run-app
),它在类路径上留下spring-security-core 3.0.7
,但它不会作为WAR运行。当我删除这些依赖项时,应用程序作为WAR运行良好,但我需要这些依赖项中的功能。我唯一能想到的就是我需要spring-security-core 3.1.4
。
是否有使用spring-security-core 3.1.x
(最好是3.1.4)的grails spring安全插件的版本?