org.springframework.expression.spel.SpelEvaluationException

tip

You can only access stepExecutionContext within a bean defined in the scope = "step", add "scope = "step"" to your bean declaration.

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

tip

If you're not using an embedded servlet container, try do disable the white label in your application.properties, with "server.error.whitelabel.enabled = false" otherwise check this answer on stackoverflow: https://goo.gl/rG0vKE

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • I have this very simple repository setup. {code:java} public interface CompanyRepository extends CrudRepository<CompanyModel, Integer> { @Override @Cacheable(value = "comp", key = "#id.toString()") CompanyModel findOne(Integer id); } {code} When I add the {{@Cachable}} annotation to cache the record in redis, I get a null pointer exception. Without the {{@Cachable}}, the record is retrieved without any issues. {noformat} org.springframework.expression.spel.SpelEvaluationException: EL1011E:(pos 4): Method call: Attempted to call method toString() on null context object at org.springframework.expression.spel.ast.MethodReference.throwIfNotNullSafe(MethodReference.java:137) at org.springframework.expression.spel.ast.MethodReference.getValueRef(MethodReference.java:68) at org.springframework.expression.spel.ast.CompoundExpression.getValueRef(CompoundExpression.java:63) at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:84) at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:103) at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:94) at org.springframework.cache.interceptor.ExpressionEvaluator.key(ExpressionEvaluator.java:103) at org.springframework.cache.interceptor.CacheAspectSupport$CacheOperationContext.generateKey(CacheAspectSupport.java:429) at org.springframework.cache.interceptor.CacheAspectSupport.generateKey(CacheAspectSupport.java:325) at org.springframework.cache.interceptor.CacheAspectSupport.findCachedItem(CacheAspectSupport.java:278) at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:201) at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:181) at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy96.findOne(Unknown Source) {noformat}
    via by Satish,
  • I have this very simple repository setup. {code:java} public interface CompanyRepository extends CrudRepository<CompanyModel, Integer> { @Override @Cacheable(value = "comp", key = "#id.toString()") CompanyModel findOne(Integer id); } {code} When I add the {{@Cachable}} annotation to cache the record in redis, I get a null pointer exception. Without the {{@Cachable}}, the record is retrieved without any issues. {noformat} org.springframework.expression.spel.SpelEvaluationException: EL1011E:(pos 4): Method call: Attempted to call method toString() on null context object at org.springframework.expression.spel.ast.MethodReference.throwIfNotNullSafe(MethodReference.java:137) at org.springframework.expression.spel.ast.MethodReference.getValueRef(MethodReference.java:68) at org.springframework.expression.spel.ast.CompoundExpression.getValueRef(CompoundExpression.java:63) at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:84) at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:103) at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:94) at org.springframework.cache.interceptor.ExpressionEvaluator.key(ExpressionEvaluator.java:103) at org.springframework.cache.interceptor.CacheAspectSupport$CacheOperationContext.generateKey(CacheAspectSupport.java:429) at org.springframework.cache.interceptor.CacheAspectSupport.generateKey(CacheAspectSupport.java:325) at org.springframework.cache.interceptor.CacheAspectSupport.findCachedItem(CacheAspectSupport.java:278) at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:201) at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:181) at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy96.findOne(Unknown Source) {noformat}
    via by Satish,
  • Spring Caching key generator
    via Stack Overflow by user3561481
    ,
    • org.springframework.expression.spel.SpelEvaluationException: EL1011E:(pos 4): Method call: Attempted to call method toString() on null context object at org.springframework.expression.spel.ast.MethodReference.throwIfNotNullSafe(MethodReference.java:137) at org.springframework.expression.spel.ast.MethodReference.getValueRef(MethodReference.java:68) at org.springframework.expression.spel.ast.CompoundExpression.getValueRef(CompoundExpression.java:63) at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:84) at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:103) at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:94) at org.springframework.cache.interceptor.ExpressionEvaluator.key(ExpressionEvaluator.java:103) at org.springframework.cache.interceptor.CacheAspectSupport$CacheOperationContext.generateKey(CacheAspectSupport.java:429) at org.springframework.cache.interceptor.CacheAspectSupport.generateKey(CacheAspectSupport.java:325) at org.springframework.cache.interceptor.CacheAspectSupport.findCachedItem(CacheAspectSupport.java:278) at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:201) at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:181) at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:60) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) at com.sun.proxy.$Proxy96.findOne(Unknown Source)

    Users with the same issue

    Malcshour
    9 times, last one,
    Unknown visitor1 times, last one,
    serious2monkeys
    2 times, last one,
    Unknown visitor1 times, last one,
    aidoan
    2 times, last one,
    64 more bugmates