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

注意:此问题仍然没有正确答案!

我正在使用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用户的错误消失了.可能存在一些缓存问题.

如何解决此错误?

编辑:这是我要求的GSP:

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

我的控制器使用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 taglibs与您的include一起使用,或者不使用
包括在内.
>另一个解决方案是重构页面以加载
你的碎片与ajax.

例如,将include包含在spring安全标签中,以仅在用户具有正确角色时显示:

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

[]的

原文地址:https://codeday.me/bug/20191119/2040092.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


背景:    8月29日,凌晨4点左右,某服务告警,其中一个节点直接down掉,收到告警的同事让运维重启。    9点左右,内存监控上发现内存异常,堆内存涨速很快,即便GC也没有什么效果,频繁GC。    9点38,服务各种超时,影响整个app使用。处理方式:    当时由于很想要
https://support.smartbear.comeadyapi/docs/soapui/steps/groovy.htmlGettestcaseobjectToobtaintheobjectwhichreferstothecontainingtestcase,usethefollowingcodesnippet:Groovy def case=testRunner.testCase; Byusingthe tes
有几个选项可用于执行自定义JMeter脚本并扩展基线JMeter功能。查看最流行的扩展机制,比较性能并分析哪一个是最好的。  这是乐队之战,JMeter风格。 BeanshellV.JSR223V.JavaRequestSampler 在我们之前的帖子中,  JMeterPerformance和TuningTips  ( 由fantastik
Scala和Java为静态语言,Groovy为动态语言Scala:函数式编程,同时支持面向对象Groovy:jvm上的脚本,较好兼容java语法,Groovy加强了Java集成。 可配置化的优势,可以将一些简单的逻辑公开给外部编辑和使用,增强了互操作性,复杂逻辑来说,可配置化代码的调试则会比较麻烦 Scala和Java
出处:https://www.jianshu.com/p/ce6f8a1f66f4一、一些内部元件的访问testRunner.testCase开头1、向下访问testRunner.testCase.testSteps[testStepName]testRunner.testCase.getTestStepByName("新增一个空间")2、向上访问,用于访问同一项目中的其他testSuites和testCase下
在运行groovy的junit方法时,报了这个错误:java.lang.ExceptionInInitializerError atorg.codehaus.groovy.reflection.ClassInfo.isValidWeakMetaClass(ClassInfo.java:271) atorg.codehaus.groovy.reflection.ClassInfo.getMetaClassForClass(ClassInfo.java:241) atorg.codeha
基本语法1.Grovvy的注释分为//和/**/和java的一样.2.Grovvy语法可以不已分号结尾.3.单引号,里面的内容严格的对应java中的String,不对$符号进行转义.defs1='iamastudent$'printlns1iamastudent$4.双引号“”的内容中如果有$号的话,会先对表达式先求值.de
Tiobe发布了最新一期(3月份)编程语言欢迎度榜单,其榜单根据互联网上有经验的程序员、课程和第三方厂商的数量,并使用搜索引擎(如Google、Bing、Yahoo!)以及Wikipedia、Amazon、YouTube统计出排名数据。TOP5几乎没有变化,Java和C语言牢牢占据前两名。Python相较去年上升一位进入TOP3,C++下
我有一个Google地图组件,作者可以在其中指定纬度和经度.我正在使用带有正则表达式的常规“输入”类型控件来验证它们是否是数字,但是,当试图解决指定范围的问题时(经度验证该值在[-180,180]内并且纬度[-90,90])但是,通过正则表达式进行验证似乎很麻烦,而且利用inputtype=“numb
我正在为未来的应用程序评估SpringBoot,并希望使用Groovy模板来实现其纯粹的可读性.不幸的是,我在迭代我添加到控制器返回的ModelAndView对象的对象列表时遇到了麻烦.这是我的控制器:@RestController@RequestMapping("/ships")publicclassShipsController{@Autowired
我有一个基于Spring的java应用程序,其中包含一些有用的组件.作为系统的一部分,我有一个groovy脚本,来处理一些报告.我想从groovy脚本中调用spring组件.当我用Java编写时,我需要在@Component中使用@Autowired注释,即@ComponentclassReporter{@AutowiredSearchServicesearchS
在Grailsi18n插件definedthusly中定义了一个messageSourcebean:messageSource(PluginAwareResourceBundleMessageSource){basenames=baseNames.toArray()fallbackToSystemLocale=falsepluginManager=manager....}是否可以覆盖我的resources.groovy中的fa
我正在寻找一种方法来反向工程RDBMS表(MSSQLServer)并生成JPA@EntityGroovy类.我们目前没有选择使用Grails和/或GORM,因此Grailsdb-reverse-engineer插件似乎很接近但不太正确.它生成符合GORM的类而不是JPA实体类.我们目前有一个gradle构建,它利用org.hibernate.tool.ant.Hibe
https://blog.csdn.net/Gdeer/article/details/83062523一、直接运行groovy程序因为groovy插件和android插件不兼容,所以不能在原始项目上使用groovy。 新建module,创一个JavaLibrary,取名lib。  修改lib/build.gradleapplyplugin:'java-library'depe
一、自动生成GET请求脚本1、配置Createascript在ngrinder管理台主页,点击script–>Createascript,并填写脚本名称和请求的url,如下所示:点击Create按钮,nGrinder会自动生成对应的脚本结构,如果没有参数需要设置的话,可以直接运行了。二、详细解析GET请求脚本ngrinder自动生成的脚本
我正在关注使用列表和地图作为构造函数的this博文.为什么以下列表无法强制反对?classTest{staticclassTestObject{privateinta=1;protectedintb=2;publicintc=3;intd=4;Strings="s";}stati
Information:java:Errorsoccurredwhilecompilingmodule'security'Information:javac1.8.0_131wasusedtocompilejavasourcesInformation:2019/6/98:31-Buildcompletedwith1errorand0warningsin3s116msError:java:读取E:\repository\org
ngrinder中的groovy脚本结构类似junit,同时在junit的基础之上封装了自己的注解,用来控制脚本的运行。一、运行逻辑图如下:此处只列出了groovy脚本的逻辑,jython脚本是类似的,在此不再单独介绍。二、各注解的使用比较三、关注点在ngrinder中,通常使用单进程多线程就足够大部分测试了,所以:
我有一个switch语句来处理javaenumfoo,并使用spock编写一些groovy单元测试.我已经添加了一个测试,它验证当前是否处理了每种类型的foo而没有抛出异常.现在我想测试一个无法识别的foo类型会导致抛出异常.要做到这一点,我将不得不嘲笑枚举,并已经看到这里概述的解决方案:MockingJ
我有一个groovy实体ClientInvoiceAttachmentExt,它扩展了java实体ClientInvoiceAttachment.ClientInvoiceAttachment具有@Id注释,但仍然看到“没有为实体指定的标识符”错误这是我的堆栈跟踪[Mar0317:11:54]ERROR|org.springframework.web.context.ContextLoader|Contex