spelevaluationexception

SpelEvaluationException: EL1007E:(pos 43): Field or property 'group' cannot be found on null

Deadly 提交于 2019-12-30 04:37:07
问题 I have SPRING METHOD security fully configured for my web application. (with PRE/POST annotations enabled). However recently I encountered a strange issue with them. Summary as follows: Summary of POJOS // User Class public class User { int id; String name; // getters and setters } // Group Class public class Group { int id; String name; // getters and setters } // GroupMembership class public class GroupMembership { private int id; private User user; private Group group; // getters and

Unable to validate role in Spring Security for url pattern

血红的双手。 提交于 2019-12-12 10:28:31
问题 I am using spring security 3.1.7.RELEASE with spring 3.2.13.RELEASE. I have entry in my spring-security.xml as follows: <http auto-config="true" use-expressions="true"> <intercept-url pattern=".*admin.htm" access="hasRole(ROLE_ADMIN)" /> <intercept-url pattern="/siteadmin/*.htm" access="ROLE_ADMIN" /> <intercept-url pattern="/siteadmin/cleancache.htm" access="hasRole('ROLE_ADMIN')" /> When I try to hit url /siteadmin/cleancache.htm I get following exception: java.lang.IllegalArgumentException

@Cacheble annotation on no parameter method

非 Y 不嫁゛ 提交于 2019-12-04 09:04:58
问题 I want to have @Cacheable annotation on method with no parameter. In that case, I use @Cacheable as follows @Cacheable(value="usercache", key = "mykey") public string sayHello(){ return "test" } However, when I call this method, it doesn't get executed and it get exception as below org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Property or field 'mykey' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject' - maybe

@Cacheble annotation on no parameter method

五迷三道 提交于 2019-12-03 01:59:43
I want to have @Cacheable annotation on method with no parameter. In that case, I use @Cacheable as follows @Cacheable(value="usercache", key = "mykey") public string sayHello(){ return "test" } However, when I call this method, it doesn't get executed and it get exception as below org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Property or field 'mykey' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject' - maybe not public? Please suggest. It seems that Spring doesn't allow you to provide a static text for the cache

spring security : Why can't we access Hibernate entitiy parameters in @PreAuthorize?

无人久伴 提交于 2019-12-01 20:24:28
问题 I have the following interface method on which I am applying @PreAuthoriz e : @PreAuthorize("doSomething(#user.id)") void something(User user, List<User> accessList); where User is a Hibernate entity object. It gives me an error : org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 13): Field or property 'id' cannot be found on null at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:204) There is no way that the

spring security : Why can't we access Hibernate entitiy parameters in @PreAuthorize?

百般思念 提交于 2019-12-01 18:46:43
I have the following interface method on which I am applying @PreAuthoriz e : @PreAuthorize("doSomething(#user.id)") void something(User user, List<User> accessList); where User is a Hibernate entity object. It gives me an error : org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 13): Field or property 'id' cannot be found on null at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:204) There is no way that the user parameter is null, as if I remove the annotation, and inspect the value of user in the method

SpelEvaluationException Method cannot be found

青春壹個敷衍的年華 提交于 2019-12-01 13:23:23
I am facing with the next problem, when I am trying to pass the User to the service method using SpEL, evaluate expression="commonService.userTest(user)" result="flowScope.user" spring throws me the following exception: org.springframework.expression.spel.SpelEvaluationException: EL1004E:(pos 14): Method call: Method userTest(com.x.domain.common.User) cannot be found on com.sun.proxy.$Proxy114 type But when I am passing a plain text instead of the User object, evaluate expression="commonService.userTest('Hello')" result="flowScope.user" There are no errors. @Entity @Table(name = "users")

SpelEvaluationException Method cannot be found

a 夏天 提交于 2019-12-01 10:16:23
问题 I am facing with the next problem, when I am trying to pass the User to the service method using SpEL, evaluate expression="commonService.userTest(user)" result="flowScope.user" spring throws me the following exception: org.springframework.expression.spel.SpelEvaluationException: EL1004E:(pos 14): Method call: Method userTest(com.x.domain.common.User) cannot be found on com.sun.proxy.$Proxy114 type But when I am passing a plain text instead of the User object, evaluate expression=

SpelEvaluationException: EL1007E:(pos 43): Field or property 'group' cannot be found on null

北慕城南 提交于 2019-11-30 13:47:20
I have SPRING METHOD security fully configured for my web application. (with PRE/POST annotations enabled). However recently I encountered a strange issue with them. Summary as follows: Summary of POJOS // User Class public class User { int id; String name; // getters and setters } // Group Class public class Group { int id; String name; // getters and setters } // GroupMembership class public class GroupMembership { private int id; private User user; private Group group; // getters and setters } PreAuthorise filter on method . @PreAuthorize("canIEditGroupProfile(#membership.group.id)") public