title: Getting error "After parsing a valid expression, there is still more data in the expression: 'lcurly({)'"
body: <p>I am using Spring-Integration for my project. I am experimenting with reading of the property/constant values from xml file (instead of .properties file).My xml file in which the properties/constants are placed is as below:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;config&gt;
  
     &lt;persistence&gt;
        &lt;dataSourceName&gt;CS/PowerSTEPP_CSSTEPPQA&lt;/dataSourceName&gt;
     &lt;/persistence&gt;
    &lt;customerservice&gt;
     &lt;headerNames&gt;
     &lt;jobName&gt;jobDesignerJobName&lt;/jobName&gt;
     &lt;/headerNames&gt;
     &lt;headerNames&gt;
        &lt;originalPayload&gt;originalPayload&lt;/originalPayload&gt;
     &lt;/headerNames&gt;
     &lt;headerNames&gt;
        &lt;originalPayloadDuplicate&gt;originalPayload&lt;/originalPayloadDuplicate&gt;
     &lt;/headerNames&gt;
     &lt;headerNames&gt;
        &lt;legacySystem&gt;legacySystem&lt;/legacySystem&gt;
     &lt;/headerNames&gt;
     &lt;headerNames&gt;
        &lt;businessArea&gt;businessArea&lt;/businessArea&gt;
     &lt;/headerNames&gt;
     &lt;routing&gt;
        &lt;jobChannel&gt;headers.jobDesignerJobName+'-InputChannel'&lt;/jobChannel&gt;
     &lt;/routing&gt;
     &lt;routing&gt;
        &lt;jobErrorChannel&gt;headers.jobDesignerJobName+'-XsltTransformInputChannel'&lt;/jobErrorChannel&gt;
     &lt;/routing&gt;
     &lt;legacySystem&gt;
        &lt;powerstepp&gt;PowerSTEPP&lt;/powerstepp&gt;
     &lt;/legacySystem&gt;
     &lt;PQProviderSearch&gt;
        &lt;storedProcedureName&gt;PQPRVSCH&lt;/storedProcedureName&gt;
     &lt;/PQProviderSearch&gt;
     &lt;PQProviderSearch&gt;
        &lt;ROWREQ&gt;00001&lt;/ROWREQ&gt;
     &lt;/PQProviderSearch&gt;
     &lt;PQProviderSearch&gt;
        &lt;DBGFLG&gt;Y&lt;/DBGFLG&gt;
     &lt;/PQProviderSearch&gt;
     &lt;PQProviderSearch&gt;
        &lt;SECDAT&gt;&lt;/SECDAT&gt;
     &lt;/PQProviderSearch&gt;
     &lt;stylesheet&gt;
        &lt;PQProviderSearch&gt;classpath:/CustomerServiceRD/spring-integration/stylesheets/PQProviderSearch.xsl&lt;/PQProviderSearch&gt;
     &lt;/stylesheet&gt;
     &lt;stylesheet&gt;
        &lt;PQProviderSearchCount&gt;classpath:/CustomerServiceRD/spring-integration/stylesheets/PQProviderSearchCount.xsl&lt;/PQProviderSearchCount&gt;
     &lt;/stylesheet&gt;
     &lt;resultSet&gt;
        &lt;legacySystem&gt;system&lt;/legacySystem&gt;
     &lt;/resultSet&gt;
     &lt;resultSet&gt;
        &lt;rootNode&gt;results&lt;/rootNode&gt;
     &lt;/resultSet&gt;
     &lt;responseXml&gt;
        &lt;soapTemplate&gt;CustomerServiceRD/JobDesigner-responseTemplate.xml&lt;/soapTemplate&gt;
     &lt;/responseXml&gt;
     &lt;responseXml&gt;
        &lt;xmlBodyTag&gt;//PQ&lt;/xmlBodyTag&gt;
     &lt;/responseXml&gt;
     &lt;http&gt;
        &lt;header&gt;
           &lt;ressponseXml&gt;
              &lt;contentType&gt;
                 &lt;value&gt;CustomerServiceRD/JobDesigner-responseTemplate.xml&lt;/value&gt;
              &lt;/contentType&gt;
           &lt;/ressponseXml&gt;
        &lt;/header&gt;
     &lt;/http&gt;
     &lt;http&gt;
        &lt;header&gt;
           &lt;contentType&gt;
              &lt;value&gt;CustomerServiceRD/JobDesigner-responseTemplate.xml&lt;/value&gt;
           &lt;/contentType&gt;
        &lt;/header&gt;
     &lt;/http&gt;
     &lt;error&gt;
        &lt;Fault&gt;Fault&lt;/Fault&gt;
     &lt;/error&gt;
     &lt;error&gt;
        &lt;errorCode&gt;1111&lt;/errorCode&gt;
     &lt;/error&gt;
     &lt;headerNames&gt;
        &lt;hostAddress&gt;hostAddress&lt;/hostAddress&gt;
     &lt;/headerNames&gt;
     &lt;headerNames&gt;
        &lt;hostPort&gt;hostPort&lt;/hostPort&gt;
     &lt;/headerNames&gt;
     &lt;error&gt;
        &lt;Fault&gt;faultcode&lt;/Fault&gt;
     &lt;/error&gt;
     &lt;error&gt;
        &lt;faultstring&gt;faultstring&lt;/faultstring&gt;
     &lt;/error&gt;
     &lt;error&gt;
        &lt;faultactor&gt;faultactor&lt;/faultactor&gt;
     &lt;/error&gt;
     &lt;error&gt;
        &lt;detail&gt;detail&lt;/detail&gt;
     &lt;/error&gt;
     &lt;label&gt;
        &lt;externalSystem&gt;ExternalSystem&lt;/externalSystem&gt;
     &lt;/label&gt;
     &lt;/customerservice&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p>Now, I am trying to read the above values in spring integration configuration files as below:</p>
  
  <pre><code>&lt;beans 
      &lt;import resource="spring-integration/Jobs/*.xml"/&gt;
  
      &lt;!-- map of namespace prefix to URI --&gt;
      &lt;util:map id="xmlMessageNamespace"&gt;
          &lt;entry key="SOAP" value="http://schemas.xmlsoap.org/soap/envelope/" /&gt;
      &lt;/util:map&gt;
      &lt;int:channel id="jobDesignerInputChannel" /&gt;
      &lt;int:channel id="cs-exceptionHandlingChannel" /&gt;
  
      &lt;bean id="msgHandler" class="com.dsths.cs.awd.jobs.PQMessageHandler" /&gt;
  
      &lt;!-- TODO: Following lines are commented out as part of POC.--&gt;
      &lt;!--&lt;bean id="xmlAggregator" class="com.dsths.cs.awd.jobs.XmlAggregator" /&gt;
      &lt;bean id="httpOutboundGatewayHandler" class="com.dsths.cs.awd.jobs.HttpOutboundGatewayHandler" /&gt;
      &lt;!--&lt;bean id="xmlFilter" class="com.dsths.cs.awd.jobs.XmlFilter" /&gt;--&gt;
  
      &lt;int:chain input-channel="jobDesignerInputChannel" &gt;
  
          &lt;int-xml:xpath-header-enricher default-overwrite="true"  should-skip-nulls="true"  &gt;
              &lt;int-xml:header name="${customerservice.headerNames.legacySystem}"  xpath-expression="//LegacySystem"  evaluation-type="STRING_RESULT"  overwrite="true" /&gt;   
          &lt;/int-xml:xpath-header-enricher&gt;        
  
          &lt;!-- Some of the AWD jobs contain Business Area info under &lt;code&gt; tag, we should not keep that business area info in the 
          header since it is not required.This will help us in identifying AWD and Non-AWD jobs--&gt;
          &lt;int:header-enricher&gt;
              &lt;int:header name="${customerservice.headerNames.businessArea}" expression="#xpath(payload, '//businessArea/Code', 'boolean') ? null : #xpath(payload, '//businessArea')"/&gt;
          &lt;/int:header-enricher&gt;
  
          &lt;int:router expression="${customerservice.routing.jobChannel}"/&gt;
      &lt;/int:chain&gt;
  
      &lt;int:chain input-channel="cs-exceptionHandlingChannel"&gt;
          &lt;!-- Service Activator to handle the errors --&gt; 
          &lt;int:service-activator  ref="msgHandler" method="handleError" /&gt;
  
          &lt;!-- Router to routing the error messages to appropriate job channel for xsl transormation --&gt;      
          &lt;int:router expression="${customerservice.routing.jobErrorChannel}"/&gt;
      &lt;/int:chain&gt;           
  &lt;/beans&gt;
  </code></pre>
  
  <p>But, unfortunately I am getting the following exception when try to read the properties from the xml file:</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.handler.MessageHandlerChain#3': Cannot create inner bean 'org.springframework.integration.handler.MessageHandlerChain#3$child#2.handler' of type [org.springframework.integration.config.RouterFactoryBean] while setting bean property 'handlers' with key [2]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.handler.MessageHandlerChain#3$child#2.handler': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
  PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'expressionString' threw exception; nested exception is org.springframework.expression.spel.SpelParseException: EL1041E:(pos 1): After parsing a valid expression, there is still more data in the expression: 'lcurly({)'
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:153)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
      at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:103)
      at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
      at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124)
      at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148)
      ... 24 more
  Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.handler.MessageHandlerChain#3$child#2.handler': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
  PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'expressionString' threw exception; nested exception is org.springframework.expression.spel.SpelParseException: EL1041E:(pos 1): After parsing a valid expression, there is still more data in the expression: 'lcurly({)'
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1396)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
      ... 42 more
  Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
  PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'expressionString' threw exception; nested exception is org.springframework.expression.spel.SpelParseException: EL1041E:(pos 1): After parsing a valid expression, there is still more data in the expression: 'lcurly({)'
      at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:102)
      at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)
      ... 46 more
  </code></pre>
  
  <p>Anybody have any idea where I am doing wrong?
  Please let me know if my question is not clear.</p>