例如在mule-config.xml文件中,如果我们有

- -开始

spring:bean id="objPool" class="org.apache.commons.pool.impl.GenericObjectPool"

spring:property name="whenExhaustedAction" value="#

{org.apache.commons.pool.impl.GenericObjectPool.WHEN_EXHAUSTED_GROW}"


- -结束

在这里,WHEN_EXHAUSTED_GROW是公共静态最后一个字节,其值为2。

现在,当我执行mule -config mule-config.xml时,出现以下错误

错误:

org.mule.api.lifecycle.InitialisationException: Initialisation Failure: Error creating bean with name 'videoRequestSAXParserObjectPool' defined in URL [file:/home/joshlabs/codebase/collider-server-tidal/src/main/resources/mule-config-pingback.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.lang.String] to required type [byte] for property 'whenExhaustedAction'; nested exception is java.lang.NumberFormatException: For input string: "{org.apache.commons.pool.impl.GenericObjectPool.WHEN_EXHAUSTED_GROW}"


请帮我如何将“字节”数据类型转换为“字符串”数据类型。

谢谢,
王子

最佳答案

Mule 2.1.2依赖于Spring 2.5.6,后者不支持Spring Expression Language(SpEL)。在Spring 2中,您需要使用util:constant读取WHEN_EXHAUSTED_GROW值并将其注入。

07-28 02:39
查看更多