Loading
Slack 관련 문의처가 Salesforce Help로 통합 및 변경됩니다.더 많이 읽기

Build fails with "(java.lang.NumberFormatException: For input string: compile failed: Exception resolving param" when using Mule Maven Plugin version 3.6.x and 3.7.0

게시 일자: Dec 6, 2024
솔루션

SYMPTOM

When trying to build your application which uses Property Placeholder values for certain attributes such as the following example with a HTTP Request element:

<http:request method="GET" doc:name="HTTP-Request-1" doc:id="ba4a46d9-917b-471a-bb83-3ef27afb5a96" config-ref="HTTP_Request_configuration" path="/test">
    <reconnect frequency="${https.requestReconnect.frequency}" count="${https.requestReconnect.attempts}" />
</http:request>

You are seeing build errors like the following example:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.371 s
[INFO] Finished at: 2022-04-07T10:07:54+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.6.0:compile (default-compile) on project placeholder-test: Execution default-compile of goal org.mule.tools.maven:mule-maven-plugin:3.6.0:compile failed: Exception resolving param 'count' with value '${https.requestReconnect.attempts}' at 'placeholder-test.xml:19:13' (java.lang.NumberFormatException: For input string: "${https.requestReconnect.attempts}") -> [Help 1]

CAUSE

Mule Maven Plugin release 3.6.0 performs additional validation checks on the XML content of your applications, in this instance the XML is correct and this error is incorrectly flagged. This issue has been reported to our Engineering team and is currently under investigation.

SOLUTION

This has been fixed by Mule Maven Plugin 3.7.3

https://docs.mulesoft.com/release-notes/mule-maven-plugin/mule-maven-plugin-3.7.3-release-notes

The plugin no longer fails to validate the XML in the Reconnection Strategy element if the values are set with property placeholders instead of inline number values.
W-11068928

 

Alternatively, this error can be avoided in one of two ways:

  1. Downgrade to the Mule Maven Plugin 3.5.4 release where this validation is not performed.

  2. Define these values inline in the XML instead of via a property placeholder, as per the updated example below:

    <http:request method="GET" doc:name="HTTP-Request-1" doc:id="ba4a46d9-917b-471a-bb83-3ef27afb5a96" config-ref="HTTP_Request_configuration" path="/test">
        <reconnect frequency="1000" count="5" />
    </http:request>
Knowledge 기사 번호

001120219

 
로드 중
Salesforce Help | Article