gpt4 book ai didi

java - 无法找到对象标识 'org.springframework.security.acls.domain.ObjectIdentityImpl 的 ACL 信息

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:42:23 24 4
gpt4 key购买 nike

注意:此题还没有正确答案!

我正在运行带有 Spring Security 2.0RC5 和 ACL 2RC2 的 Grails 2.4.5。当我使用 ROLE_ADMIN 和 ROLE_USER 帐户登录时,有时会出现以下错误。

2015-08-28 16:05:17,994 [http-nio-8080-exec-7] ERROR [/majestella].[grails]  - Servlet.service() for servlet grails threw exception
Message: Unable to find ACL information for object identity 'org.springframework.security.acls.domain.ObjectIdentityImpl[Type: majestella.Company; Identifier: 50e396b8eebefc5a84]'
Line | Method
->> 292 | readAclsById in grails.plugin.springsecurity.acl.AclService
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 38 | myhotels in majestella.admin.AdminHotelController
| 198 | doFilter . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 32 | doCall . . . . . in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp$_run_closure2
| 39 | run in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp
| 198 | doFilter . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 53 | doFilter . . . . in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
| 62 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 46 | doFilterInternal in org.grails.jaxrs.web.JaxrsFilter
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Error |
2015-08-28 16:05:18,035 [http-nio-8080-exec-7] ERROR errors.GrailsExceptionResolver - NotFoundException occurred when processing request: [GET] /majestella/admin
Unable to find ACL information for object identity 'org.springframework.security.acls.domain.ObjectIdentityImpl[Type: majestella.Company; Identifier: 50e396b8eebefc5a84]'. Stacktrace follows:
Message: Error processing GroovyPageView: Error executing tag <g:include>: Unable to execute include: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [myhotels] of controller [majestella.admin.AdminHotelController] caused exception: Runtime error executing action
Line | Method
->> 527 | doFilter in /grails-app/views/admin/index.gsp
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Caused by GrailsTagException: Error executing tag <g:include>: Unable to execute include: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [myhotels] of controller [majestella.admin.AdminHotelController] caused exception: Runtime error executing action
->> 32 | doCall in /grails-app/views/admin/index.gsp
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Caused by ControllerExecutionException: Unable to execute include: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [myhotels] of controller [majestella.admin.AdminHotelController] caused exception: Runtime error executing action
->> 32 | doCall in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp$_run_closure2
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 39 | run in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp
| 198 | doFilter . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 53 | doFilter . . . . in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
| 62 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 46 | doFilterInternal in org.grails.jaxrs.web.JaxrsFilter
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by ServletException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executing action [myhotels] of controller [majestella.admin.AdminHotelController] caused exception: Runtime error executing action
->> 116 | logThrowable in grails.plugin.cache.web.filter.AbstractFilter
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 70 | doFilter in ''
| 32 | doCall . . . . . in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp$_run_closure2
| 39 | run in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp
| 198 | doFilter . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 53 | doFilter . . . . in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
| 62 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 46 | doFilterInternal in org.grails.jaxrs.web.JaxrsFilter
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by ControllerExecutionException: Executing action [myhotels] of controller [majestella.admin.AdminHotelController] caused exception: Runtime error executing action
->> 198 | doFilter in grails.plugin.cache.web.filter.PageFragmentCachingFilter
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 32 | doCall . . . . . in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp$_run_closure2
| 39 | run in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp
| 198 | doFilter . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 53 | doFilter . . . . in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
| 62 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 46 | doFilterInternal in org.grails.jaxrs.web.JaxrsFilter
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by ControllerExecutionException: Runtime error executing action
->> 198 | doFilter in grails.plugin.cache.web.filter.PageFragmentCachingFilter
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 32 | doCall . . . . . in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp$_run_closure2
| 39 | run in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp
| 198 | doFilter . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 53 | doFilter . . . . in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
| 62 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 46 | doFilterInternal in org.grails.jaxrs.web.JaxrsFilter
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by InvocationTargetException: null
->> 198 | doFilter in grails.plugin.cache.web.filter.PageFragmentCachingFilter
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 32 | doCall . . . . . in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp$_run_closure2
| 39 | run in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp
| 198 | doFilter . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 53 | doFilter . . . . in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
| 62 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 46 | doFilterInternal in org.grails.jaxrs.web.JaxrsFilter
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by NotFoundException: Unable to find ACL information for object identity 'org.springframework.security.acls.domain.ObjectIdentityImpl[Type: majestella.Company; Identifier: 50e396b8eebefc5a84]'
->> 292 | readAclsById in grails.plugin.springsecurity.acl.AclService
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 38 | myhotels in majestella.admin.AdminHotelController
| 198 | doFilter . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 32 | doCall . . . . . in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp$_run_closure2
| 39 | run in Users_mg_Documents_Grails_GGTS3_6_4_Server_majestella_grails_app_views_admin_index_gsp
| 198 | doFilter . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 53 | doFilter . . . . in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
| 62 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 46 | doFilterInternal in org.grails.jaxrs.web.JaxrsFilter
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread

在同一页面上使用具有 ROLE_USER 的帐户我没有收到此错误。

当我重新启动服务器时,ROLE_ADMIN 和 ROLE_USER 用户的错误消失了。可能存在一些缓存问题。

如何修复此错误?

编辑:这是我要求的普惠制:

some html code
<g:include controller="adminUser" action="myUsers" />

我的 Controller 使用 Spring Security Annotation:

@Secured(AccessRole.ROLE_USER)
class AdminController {
def index() {}
}

编辑:这是我包含的 GSP 的内容:

<%@ page import="test.Hotel" %>


<g:each in="${hotels}" var="hotel">
<g:render template="hotel" model="[hotel: hotel]" />
</g:each>

最佳答案

我至少还需要查看您的 GSP,但我敢打赌您的问题与 <g:include> 的使用有关以及您如何使用 SpringSecurity。

您可以尝试删除 <g:include>从您的页面中提取标签并再次运行您的测试?

问题在于 Spring Security 是使用 Servlet 过滤器实现的,并且您在检查后包含安全内容。

可能的解决方法:

  • 尝试将 Spring Security 标签库与您的包含一起使用,或者不要使用包括所有。
  • 另一种解决方案是重构要加载的页面使用 ajax 的片段。

例如,将您的 includes 包含在 spring security 标签中,以便仅在用户具有正确的角色时显示:

<sec:ifAnyGranted roles="ROLE_USER">
<g:include controller="adminUser" action="myUsers" />
</sec:ifAnyGranted>

[]的

关于java - 无法找到对象标识 'org.springframework.security.acls.domain.ObjectIdentityImpl 的 ACL 信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31701823/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com