我有一个grails项目,我刚刚将Spring Security Core插件升级到最新版本,但是在尝试运行应用程序时收到以下消息:
| Error Compilation error: startup failed:
Compile error during compilation with javac.
/home/dev/.grails/2.1.0/projects/app/plugins/spring-security-ldap-1.0.6/src/java/org/codehaus/groovy/grails/plugins/springsecurity/ldap/DatabaseOnlyLdapAuthoritiesPopulator.java:20: cannot find symbol
symbol : class GrailsUserDetailsService
location: package org.codehaus.groovy.grails.plugins.springsecurity
import org.codehaus.groovy.grails.plugins.springsecurity.GrailsUserDetailsService;
^
/home/dev/.grails/2.1.0/projects/app/plugins/spring-security-ldap-1.0.6/src/java/org/codehaus/groovy/grails/plugins/springsecurity/ldap/DatabaseOnlyLdapAuthoritiesPopulator.java:37: cannot find symbol
symbol : class GrailsUserDetailsService
location: class org.codehaus.groovy.grails.plugins.springsecurity.ldap.DatabaseOnlyLdapAuthoritiesPopulator
private GrailsUserDetailsService _userDetailsService;
^
/home/dev/.grails/2.1.0/projects/app/plugins/spring-security-ldap-1.0.6/src/java/org/codehaus/groovy/grails/plugins/springsecurity/ldap/DatabaseOnlyLdapAuthoritiesPopulator.java:71: cannot find symbol
symbol : class GrailsUserDetailsService
location: class org.codehaus.groovy.grails.plugins.springsecurity.ldap.DatabaseOnlyLdapAuthoritiesPopulator
public void setUserDetailsService(final GrailsUserDetailsService service) {
^
/home/dev/.grails/2.1.0/projects/app/plugins/spring-security-ldap-1.0.6/src/java/org/codehaus/groovy/grails/plugins/springsecurity/ldap/GrailsLdapAuthoritiesPopulator.java:20: cannot find symbol
symbol : class GrailsUserDetailsService
location: package org.codehaus.groovy.grails.plugins.springsecurity
import org.codehaus.groovy.grails.plugins.springsecurity.GrailsUserDetailsService;
^
/home/dev/.grails/2.1.0/projects/app/plugins/spring-security-ldap-1.0.6/src/java/org/codehaus/groovy/grails/plugins/springsecurity/ldap/GrailsLdapAuthoritiesPopulator.java:36: cannot find symbol
symbol : class GrailsUserDetailsService
location: class org.codehaus.groovy.grails.plugins.springsecurity.ldap.GrailsLdapAuthoritiesPopulator
private GrailsUserDetailsService _userDetailsService;
^
/home/dev/.grails/2.1.0/projects/app/plugins/spring-security-ldap-1.0.6/src/java/org/codehaus/groovy/grails/plugins/springsecurity/ldap/GrailsLdapAuthoritiesPopulator.java:147: cannot find symbol
symbol : class GrailsUserDetailsService
location: class org.codehaus.groovy.grails.plugins.springsecurity.ldap.GrailsLdapAuthoritiesPopulator
public void setUserDetailsService(final GrailsUserDetailsService service) {
^
/home/dev/.grails/2.1.0/projects/app/plugins/spring-security-ldap-1.0.6/src/java/org/codehaus/groovy/grails/plugins/springsecurity/ldap/GrailsLdapUserDetailsManager.java:3: cannot find symbol
symbol : class GrailsUserDetailsService
location: package org.codehaus.groovy.grails.plugins.springsecurity
import org.codehaus.groovy.grails.plugins.springsecurity.GrailsUserDetailsService;
^
/home/dev/.grails/2.1.0/projects/app/plugins/spring-security-ldap-1.0.6/src/java/org/codehaus/groovy/grails/plugins/springsecurity/ldap/GrailsLdapUserDetailsManager.java:13: cannot find symbol
symbol: class GrailsUserDetailsService
public class GrailsLdapUserDetailsManager extends LdapUserDetailsManager implements GrailsUserDetailsService {
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
8 errors
有人可以帮忙吗?
由于
的 的 ** 修改的 * ** *
我现在已经浏览了插件和核心文件,并确保所有新的Spring Security导入都是正确的。该应用程序现在编译正常但是当我运行它并尝试访问主页时,我收到以下错误:
| Running Grails application
Configuring Spring Security UI ...
... finished configuring Spring Security UI
Configuring Spring Security Core ...
... finished configuring Spring Security Core
| Error 2014-03-10 11:44:51,598 [pool-7-thread-1] ERROR plugins.DefaultGrailsPluginManager - Error configuring dynamic methods for plugin [springSecurityCore:2.0-RC2]: null
Message: null
Line | Method
->> 308 | compileStaticRules in grails.plugin.springsecurity.web.access.intercept.AnnotationFilterInvocationDefinition
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 218 | initialize in ''
| 738 | initializeFromAnnotations in SpringSecurityCoreGrailsPlugin
| 599 | doCall in SpringSecurityCoreGrailsPlugin$_closure3
| 303 | innerRun . . . . . . . . in java.util.concurrent.FutureTask$Sync
| 138 | run in java.util.concurrent.FutureTask
| 895 | runTask . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
| 918 | run in ''
^ 662 | run . . . . . . . . . . . in java.lang.Thread
| Server running. Browse to http://localhost:8080/my_app
| Error 2014-03-10 11:49:36,541 [http-bio-8080-exec-2] ERROR [/my_app].[gsp] - Servlet.service() for servlet [gsp] in context with path [/my_app] threw exception
Message: null
Line | Method
->> 273 | isAjax in grails.plugin.springsecurity.SpringSecurityUtils
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 45 | determineUrlToUseForThisRequest in grails.plugin.springsecurity.web.authentication.AjaxAwareAuthenticationEntryPoint
| 53 | doFilter . . . . . . . . . . . in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
| 49 | doFilter in grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter
| 82 | doFilter . . . . . . . . . . . in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 895 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 918 | run . . . . . . . . . . . . . . in ''
^ 662 | run in java.lang.Thread
有人可以就此提供任何指导吗?
由于
答案 0 :(得分:3)
尝试清除所有输出文物
grails clean-all
杀死所有java进程 清除IDE的缓存并重新启动IDE并重试。
使用Intellij Idea时遇到此错误,而ReflectionUtils类的行为不一致。可能是类缓存问题。
答案 1 :(得分:1)
您可能必须升级到spring-security-ldap plugin to 2.0-RC2才能使用Spring Security Core 2.0_RC2。
<强>原因:强> 请注意最新版本的安全核心插件中的change in package name。
org.codehaus.groovy.grails.plugins.springsecurity.GrailsUserDetailsService
grails.plugin.springsecurity.userdetails.GrailsUserDetailsService
答案 2 :(得分:0)
我发现如果您正在使用注释,则需要提供一组角色而不再是一个字符串:
@Secured([&#39; IS_AUTHENTICATED_FULLY&#39;])