title: Spring java 11 getting spel issue EL1005E: Type cannot be found
body: <p>Getting below issue post upgrading Spring boot app to Java 11, this was working fine even on 2.1 spring boot on Jdk 8</p>
  <p><strong>Jdk : Correto 11</strong></p>
  <p><strong>Spring boot : 2.2.13.RELEASE</strong></p>
  <p><strong>Spring Integration : 5.2.11.RELEASE</strong></p>
  <p><strong>Code</strong> :</p>
  <pre><code> .route(&quot;headers.get(T(com.foo.integration.FlowHeaders).FEED).getProcessingMode()&quot;,
                    m -&gt; m.subFlowMapping(Feed.ProcessingMode.stream, this.streamFlow(sinkStreamProcessingHandler))
                          .subFlowMapping(Feed.ProcessingMode.batch,
                                this.batchFlow(sinkBatchProcessingHandler, props))
                          .subFlowMapping(Feed.ProcessingMode.group,
  </code></pre>
  <p><strong>Exception</strong> :</p>
  <pre><code>   ExceptionFlow - Exception in flow ... [EL1005E: Type cannot be found 'com.foo.integration.FlowHeaders'] 
      org.springframework.messaging.MessageHandlingException: Expression evaluation failed: headers.get(T(com.foo.integration.FlowHeaders).FEED).getProcessingMode(); 
  nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1005E: Type cannot be found 'com.foo.integration.FlowHeaders'
          at org.springframework.integration.support.utils.IntegrationUtils.wrapInHandlingExceptionIfNecessary(IntegrationUtils.java:191)
          at org.springframework.integration.util.AbstractExpressionEvaluator.evaluateExpression(AbstractExpressionEvaluator.java:137)
          at org.springframework.integration.handler.ExpressionEvaluatingMessageProcessor.processMessage(ExpressionEvaluatingMessageProcessor.java:107)
          at org.springframework.integration.router.AbstractMessageProcessingRouter.getChannelKeys(AbstractMessageProcessingRouter.java:84)
          at org.springframework.integration.router.AbstractMappingMessageRouter.determineTargetChannels(AbstractMappingMessageRouter.java:202)
          at org.springframework.integration.router.AbstractMessageRouter.handleMessageInternal(AbstractMessageRouter.java:170)
          at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:177)
          at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:115)
  
  Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1005E: Type cannot be found 'com.wellmanage.wfg.fdps.integration.FDPSHeaders'
      at org.springframework.expression.spel.support.StandardTypeLocator.findType(StandardTypeLocator.java:117)
      at org.springframework.expression.spel.ExpressionState.findType(ExpressionState.java:155)
      at org.springframework.expression.spel.ast.TypeReference.getValueInternal(TypeReference.java:69)
      at org.springframework.expression.spel.ast.CompoundExpression.getValueRef(CompoundExpression.java:55)
      at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:91)
      at org.springframework.expression.spel.ast.MethodReference.getArguments(MethodReference.java:164)
      at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:94)
      at org.springframework.expression.spel.ast.CompoundExpression.getValueRef(CompoundExpression.java:61)
      at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:91)
      at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:117)
      at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:375)
      at org.springframework.integration.util.AbstractExpressionEvaluator.evaluateExpression(AbstractExpressionEvaluator.java:171)
      at org.springframework.integration.util.AbstractExpressionEvaluator.evaluateExpression(AbstractExpressionEvaluator.java:129)
  </code></pre>
  <p><strong>UPDATE</strong></p>
  <p>This change somehow made it work though not completely sure as this is the same code as in the oob bean</p>
  <pre><code>@Primary       @Bean(IntegrationContextUtils.INTEGRATION_EVALUATION_CONTEXT_BEAN_NAME)
             public IntegrationEvaluationContextFactoryBean  evaluationContextFactoryBean(){
                var factoryBean = new IntegrationEvaluationContextFactoryBean();
                factoryBean.setTypeLocator(new CustomStandardTypeLocator());
                return factoryBean;
             }
          
             static class CustomStandardTypeLocator extends StandardTypeLocator {
          
                @Override
                public Class&lt;?&gt; findType(String typeName) throws EvaluationException {
                   LOG.info(&quot;Finding type {} in classloader {}&quot;, typeName, ClassUtils.getDefaultClassLoader().getName());
                   return super.findType(typeName);
                }
             }
  </code></pre>