I'm trying to use Spring EL in XML config: Creating a task executor with queue-capacity from an existing beans ConfigProp.
<task:executor id="executorWithPoolSizeRange"
pool-size="#{ConfigProp.async.corePoolSize}-#{ConfigProp.async.maxPoolSize}"
queue-capacity="#{ConfigProp.async.queueCapacity}"/>
From the Intellij IDEA, it's showing that pool-size
can be resolved properly but not for queue-capacity
, which is Integer type.
IDEA Complain message
Cannot convert string #{ConfigProp.async.queueCapacity} to target class java.lang.Integer"
Execution logs when run with Tomcat
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 129 in XML document from ServletContext resource [/WEB-INF/dispatcher-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 129; columnNumber: 69; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'task:executor'.
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:402) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
What did I do wrong or is this not supported by SpringEL?