Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix property placeholder at maxConcurrency #858

Open
SGmuwa opened this issue Jul 22, 2024 · 0 comments
Open

Fix property placeholder at maxConcurrency #858

SGmuwa opened this issue Jul 22, 2024 · 0 comments

Comments

@SGmuwa
Copy link

SGmuwa commented Jul 22, 2024

At version 4.2.0 maven send error when use a property placeholder at maxConcurrency in parallel-foreach:

Failed to execute goal org.mule.tools.maven:mule-maven-plugin:4.2.0:process-classes (default-process-classes) on project myAwasomeProjectName: A type incompatibility occurred while executing org.mule.tools.maven:mule-maven-plugin:4.2.0:process-classes: class java.lang.String cannot be cast to class java.lang.Number (java.lang.String and java.lang.Number are in module java.base of loader 'bootstrap')

To reproduce the error:
First, create xml app:

<?xml version="1.0" encoding="utf-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd">
    <global-property doc:id="ce54453a-9fb3-47d7-a666-a47fba7fd11b"
                     doc:name="Global Property"
                     name="maxConcurrency"
                     value="2" />
    <flow doc:id="13ba605b-3247-4b85-8dc2-1a0d0ea228c5"
          name="test-placeholders-numbersFlow">
        <scheduler doc:id="992a3443-7759-4276-8d83-f7e9d75804aa"
                   doc:name="Scheduler">
            <scheduling-strategy>
                <fixed-frequency />
            </scheduling-strategy>
        </scheduler>
        <parallel-foreach collection="#[1 to 2]"
                          doc:id="f82c6c5d-6052-4506-8df0-6805c9b8dfec"
                          doc:name="Parallel For Each"
                          maxConcurrency="${maxConcurrency}">
            <logger doc:id="8cd531ff-89d1-47d5-b750-a074e90dceb6"
                    doc:name="Logger"
                    level="INFO" />
        </parallel-foreach>
    </flow>
</mule>

secondly, change mule-maven-plugin from 4.1.24.2.0

Thirdly, start mvn package.

references:

  1. https://bradmcnaughton.com/mule-maven-plugin-type-incompatibility
  2. https://help.mulesoft.com/s/question/0D56R00009IZXY0SAP/error-failed-to-execute-goal-orgmuletoolsmavenmulemavenplugin420processclasses-defaultprocessclasses-on-project-in-mule-4
  3. https://issues.salesforce.com/issue/a028c00000zIzIlAAK/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant