Questions tagged [spelevaluationexception]

31 questions
29
votes
5 answers

@Cacheble annotation on no parameter method

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…
user3534483
  • 2,133
  • 5
  • 22
  • 19
23
votes
2 answers

Unable to validate role in Spring Security for url pattern

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:
9
votes
4 answers

What is the best way of defining key for @Cacheable annotation for Spring

If I am defining a ehcache for a method which doesn't have any parameter. But in my use case I needs to access the my built cache through it's key. So please provide me the better way of assigning key on it. Follow is my…
BITSSANDESH
  • 1,025
  • 4
  • 13
  • 23
8
votes
4 answers

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

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…
hemantvsn
  • 1,316
  • 3
  • 12
  • 24
6
votes
2 answers

org.springframework.expression.spel.SpelEvaluationException: EL1027E:(pos 4): Indexing into type 'com.test.domain.Employee' is not supported

I am developing an Spring Roo application and while displaying the Objects in list (in list.jspx), I am getting all the properties of the referenced object. For example: @RooJavaBean @RooToString @RooJpaActiveRecord public class Employee { …
5
votes
1 answer

@PreAuthorize with Bean in expression (Spring Boot)

Simple question, I got a @Service class @Autowired up in my controller. Trying to put a little security on one of the methods in my controller. So for simplicity I did this to test @PreAuthorize("@myService.helloThere()") public void…
H.Rabiee
  • 4,747
  • 3
  • 23
  • 35
5
votes
1 answer

Jhipster - JpaRepository "principal.username" @Query - org.springframework.expression.spel.SpelEvaluationException

I have an error while I am testing my rest controller on a specific method. I am using the @Query annotation to do my database query. And it's using the "principal.username" to do it. I don't have the all picture on how principal.username is fetched…
Maurice
  • 2,129
  • 2
  • 25
  • 33
4
votes
4 answers

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

I have the following interface method on which I am applying @PreAuthorize : @PreAuthorize("doSomething(#user.id)") void something(User user, List accessList); where User is a Hibernate entity object. It gives me an error…
Daud
  • 7,429
  • 18
  • 68
  • 115
3
votes
1 answer

Spring Security Producing Null CSRF Token - Property or field 'parameterName' cannot be found on null

I have been trying to implement Spring Security for a few days and have been struggling with the csrf tokens. I've debugged down into CsrfRequestDataValueProcessor and found that the following line is returning null. CsrfToken token = (CsrfToken)…
2
votes
1 answer

How to use SPEL to reference attribute of parameter in @GatewayHeader

This should be a simple question, but I cannot find the proper doc online. I want to do this: @MessagingGateway(name = "redemptionGateway", defaultRequestChannel = Channels.GATEWAY_OUTPUT, defaultHeaders = @GatewayHeader(name = "orderId",…
2
votes
2 answers

org.springframework.expression.spel.SpelEvaluationException - Property or field cannot be found on null

I'm using thymeleaf together with spring and there's an error when parsing the following html segment
lupper
  • 21
  • 1
  • 1
  • 4
2
votes
1 answer

How to use an objects' property as the key for @CachePut?

public interface MyRespository extends CrudRepository { @CachePut(value = "mycache", key = "id") @Override public S save(S entity); } @Entity public class MyEntity { @Id private Long id; …
membersound
  • 81,582
  • 193
  • 585
  • 1,120
2
votes
1 answer

Is it possible to populate spring util:list via properties file?

I would like to populate transport End points via properties file. I tried this but it didn't work