java.lang.IllegalArgumentException: There should have been an Acl entry for ObjectIdentity org.springframework.security.acls.domain.ObjectIdentityImpl[Type: com.SomeType; Identifier: 1]

Spring JIRA | Roman Pokhodzhai | 5 years ago
  1. 0

    JdbcAclService : public Acl readAclById(ObjectIdentity object, List<Sid> sids) throws NotFoundException { Map<ObjectIdentity, Acl> map = readAclsById(Arrays.asList(object), sids); Assert.isTrue(map.containsKey(object), "There should have been an Acl entry for ObjectIdentity " + object); return (Acl) map.get(object); } IllegalArgumentException exception is thrown when acl not found. This exception is not catched anywhere and thus displayed to end user. AclPermissionEvaluator expects org.springframework.security.acls.model.NotFoundException when calling JdbcAclService.readAclById (to return permission denied) but instead exception is throwing. Suggestion : change Assert.isTrue(map.containsKey(object), "There should have been an Acl entry for ObjectIdentity " + object); to if (!map.containsKey(object)) { throw new NotFoundException("There should have been an Acl entry for ObjectIdentity "); } Stack trace: java.lang.IllegalArgumentException: There should have been an Acl entry for ObjectIdentity org.springframework.security.acls.domain.ObjectIdentityImpl[Type: com.SomeType; Identifier: 1] at org.springframework.util.Assert.isTrue(Assert.java:65) at org.springframework.security.acls.jdbc.JdbcAclService.readAclById(JdbcAclService.java:95) at org.springframework.security.acls.AclPermissionEvaluator.checkPermission(AclPermissionEvaluator.java:81) at org.springframework.security.acls.AclPermissionEvaluator.hasPermission(AclPermissionEvaluator.java:65) at org.springframework.security.access.expression.SecurityExpressionRoot.hasPermission(SecurityExpressionRoot.java:132) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:69) at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:110) at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102) at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:97)

    Spring JIRA | 5 years ago | Roman Pokhodzhai
    java.lang.IllegalArgumentException: There should have been an Acl entry for ObjectIdentity org.springframework.security.acls.domain.ObjectIdentityImpl[Type: com.SomeType; Identifier: 1]
  2. 0

    JdbcAclService : public Acl readAclById(ObjectIdentity object, List<Sid> sids) throws NotFoundException { Map<ObjectIdentity, Acl> map = readAclsById(Arrays.asList(object), sids); Assert.isTrue(map.containsKey(object), "There should have been an Acl entry for ObjectIdentity " + object); return (Acl) map.get(object); } IllegalArgumentException exception is thrown when acl not found. This exception is not catched anywhere and thus displayed to end user. AclPermissionEvaluator expects org.springframework.security.acls.model.NotFoundException when calling JdbcAclService.readAclById (to return permission denied) but instead exception is throwing. Suggestion : change Assert.isTrue(map.containsKey(object), "There should have been an Acl entry for ObjectIdentity " + object); to if (!map.containsKey(object)) { throw new NotFoundException("There should have been an Acl entry for ObjectIdentity "); } Stack trace: java.lang.IllegalArgumentException: There should have been an Acl entry for ObjectIdentity org.springframework.security.acls.domain.ObjectIdentityImpl[Type: com.SomeType; Identifier: 1] at org.springframework.util.Assert.isTrue(Assert.java:65) at org.springframework.security.acls.jdbc.JdbcAclService.readAclById(JdbcAclService.java:95) at org.springframework.security.acls.AclPermissionEvaluator.checkPermission(AclPermissionEvaluator.java:81) at org.springframework.security.acls.AclPermissionEvaluator.hasPermission(AclPermissionEvaluator.java:65) at org.springframework.security.access.expression.SecurityExpressionRoot.hasPermission(SecurityExpressionRoot.java:132) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:69) at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:110) at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102) at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:97)

    Spring JIRA | 5 years ago | Roman Pokhodzhai
    java.lang.IllegalArgumentException: There should have been an Acl entry for ObjectIdentity org.springframework.security.acls.domain.ObjectIdentityImpl[Type: com.SomeType; Identifier: 1]
  3. 0

    Application startup failed with org.hibernate:hibernate-search-orm.XYZ on class path

    GitHub | 2 years ago | dirkrathje
    java.lang.IllegalArgumentException: @ConditionalOnMissingBean annotations must specify at least one bean (type, name or annotation)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Issue of pagination in Spring Data JPA

    Stack Overflow | 5 years ago | Tom
    java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter!
  6. 0

    SubProtocolWebSocketHandler - No handlers

    Stack Overflow | 2 years ago
    org.springframework.web.context.ContextLoaderListener: org.springframework.context.ApplicationContextException: Failed to start bean 'subProtocolWebSocketHandler'; nested exception is java.lang.IllegalArgumentException: No handlers
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalArgumentException

    There should have been an Acl entry for ObjectIdentity org.springframework.security.acls.domain.ObjectIdentityImpl[Type: com.SomeType; Identifier: 1]

    at org.springframework.util.Assert.isTrue()
  2. Spring Core
    Assert.isTrue
    1. org.springframework.util.Assert.isTrue(Assert.java:65)
    1 frame
  3. spring-security-acl
    AclPermissionEvaluator.hasPermission
    1. org.springframework.security.acls.jdbc.JdbcAclService.readAclById(JdbcAclService.java:95)
    2. org.springframework.security.acls.AclPermissionEvaluator.checkPermission(AclPermissionEvaluator.java:81)
    3. org.springframework.security.acls.AclPermissionEvaluator.hasPermission(AclPermissionEvaluator.java:65)
    3 frames
  4. spring-security-core
    SecurityExpressionRoot.hasPermission
    1. org.springframework.security.access.expression.SecurityExpressionRoot.hasPermission(SecurityExpressionRoot.java:132)
    1 frame
  5. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  6. Spring Expression Language (SpEL)
    SpelExpression.getValue
    1. org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:69)
    2. org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:110)
    3. org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)
    4. org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:97)
    4 frames