org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 1): Field or property 'keyCreatorBean' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject'

Spring JIRA | Juha Syrjälä | 4 years ago
  1. 0

    I am trying to use a result of method call to a spring bean as a part of the cache key, but that doesn't seem to work. @Inject private KeyCreatorBean keyCreatorBean; @Cacheable(value = "cacheName", key = "{@keyCreatorBean.createKey, #p0}") @Override public List<Examples> getExamples(ExampleId exampleId) { Results in this kind of stack trace: org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 1): Field or property 'keyCreatorBean' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject' at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:208) at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:72) at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:52) at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93) at org.springframework.expression.spel.ast.InlineList.getValueInternal(InlineList.java:86) at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93) at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:88) at org.springframework.cache.interceptor.ExpressionEvaluator.key(ExpressionEvaluator.java:80) at org.springframework.cache.interceptor.CacheAspectSupport$CacheOperationContext.generateKey(CacheAspectSupport.java:464)

    Spring JIRA | 4 years ago | Juha Syrjälä
    org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 1): Field or property 'keyCreatorBean' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject'
  2. 0

    I am trying to use a result of method call to a spring bean as a part of the cache key, but that doesn't seem to work. @Inject private KeyCreatorBean keyCreatorBean; @Cacheable(value = "cacheName", key = "{@keyCreatorBean.createKey, #p0}") @Override public List<Examples> getExamples(ExampleId exampleId) { Results in this kind of stack trace: org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 1): Field or property 'keyCreatorBean' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject' at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:208) at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:72) at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:52) at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93) at org.springframework.expression.spel.ast.InlineList.getValueInternal(InlineList.java:86) at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93) at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:88) at org.springframework.cache.interceptor.ExpressionEvaluator.key(ExpressionEvaluator.java:80) at org.springframework.cache.interceptor.CacheAspectSupport$CacheOperationContext.generateKey(CacheAspectSupport.java:464)

    Spring JIRA | 4 years ago | Juha Syrjälä
    org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 1): Field or property 'keyCreatorBean' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject'
  3. 0

    Pass parameter to Spring soap interceptor

    Stack Overflow | 3 months ago | ViratKohli
    org.springframework.expression.spel.SpelEvaluationException: EL1008E:(pos 0): Property or field 'headers' cannot be found on object of type 'org.spri ngframework.beans.factory.config.BeanExpressionContext' - maybe not public?
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring Expression Language and Spring Security 3: accessing bean reference in @PreAuthorize

    Stack Overflow | 6 years ago | Jonck van der Kogel
    org.springframework.expression.spel.SpelEvaluationException: EL1057E:(pos 1): No bean resolver registered in the context to resolve access to bean 'testBean'
  6. 0

    Reversed if condition

    GitHub | 12 months ago | evelan
    org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 0): Property or field 'username' cannot be found on null

  1. musketyr 5 times, last 7 days ago
  2. tvrmsmith 1 times, last 1 week ago
  3. gehel 14 times, last 1 week ago
  4. serious2monkeys 1 times, last 1 month ago
  5. Pilleo 2 times, last 2 months ago
8 more registered users
49 unregistered visitors
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. org.springframework.expression.spel.SpelEvaluationException

    EL1008E:(pos 1): Field or property 'keyCreatorBean' cannot be found on object of type 'org.springframework.cache.interceptor.CacheExpressionRootObject'

    at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty()
  2. Spring Expression Language (SpEL)
    SpelExpression.getValue
    1. org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:208)
    2. org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:72)
    3. org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:52)
    4. org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93)
    5. org.springframework.expression.spel.ast.InlineList.getValueInternal(InlineList.java:86)
    6. org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:93)
    7. org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:88)
    7 frames
  3. Spring Context
    CacheAspectSupport$CacheOperationContext.generateKey
    1. org.springframework.cache.interceptor.ExpressionEvaluator.key(ExpressionEvaluator.java:80)
    2. org.springframework.cache.interceptor.CacheAspectSupport$CacheOperationContext.generateKey(CacheAspectSupport.java:464)
    2 frames