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ä | 5 years ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  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 | 5 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 | 5 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
    samebug tip
    You can only access stepExecutionContext within a bean defined in the scope = "step", add "scope = "step"" to your bean declaration.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    samebug tip
    Flow files only know how to work with Spring Beans, annotate ManagedBean with @Component('serviceProviderSubscriptionBB') or declare the managed bean directly on flow with <var name="serviceProviderSubscriptionBB" class="the full name of your class"/>
  6. 0

    Pass parameter to Spring soap interceptor

    Stack Overflow | 7 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?

  1. tomthomas 3 times, last 1 month ago
  2. batwalrus76 2 times, last 1 month ago
  3. andyglick 4 times, last 2 months ago
  4. musketyr 5 times, last 4 months ago
  5. tvrmsmith 1 times, last 4 months ago
11 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