Could not find ACL information to identify object 'org.springframework.security.acls.domain.ObjectIdentityImpl

NOTE. This question still doesn't have a correct answer!

I am running Grails 2.4.5 with Spring Security 2.0RC5 and ACL 2RC2. Sometimes I get the following error when I log in with the ROLE_ADMIN and ROLE_USER account.

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

      

Using an account with ROLE_USER on the same page, I am not getting this error.

When restarting the server, the error for users ROLE_ADMIN and ROLE_USER disappeared. There might be a caching issue or so.

How do I fix this error?

Edit: here is the GSP I requested:

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

      

My controller is using Spring Security Annotation:

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

      

Edit: Here is the content of the GSP I am including:

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


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

      

+3


source to share


3 answers


I still need to see your GSP at least, but I bet your problem is with the use <g:include>

and the way you use SpringSecurity.

Could you try to remove the tags <g:include>

from your pages and rerun the tests?

The problem is that Spring Security is implemented with Servlet filters and you include protected content after validation.

Possible workarounds:



  • Try using Spring Security Tags with your included or not using includes at all.
  • Another solution is to refactor your pages to load your fragments using ajax.

For example, include Spring security tags to show only if the user has the correct roles:

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

      

[] 's

+2


source


Message: Unable to find ACL information for object identity 'org.springframework.security.acls.domain.ObjectIdentityImpl[Type: majestella.Company; Identifier: 50e396b8eebefc5a84]'



You have not created acl records for majestella.Company

id 50e396b8eebefc5a84

in your database. Each entry must have its own permission, registered in the acl entries and related tables.

+1


source


I still don't have an answer to this question, but as a work, I removed:

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

      

0


source







All Articles