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

Response element (<response>) causes StackOverflow when used above Apikit router #456

Closed
SlightlyDave opened this issue Feb 3, 2021 · 5 comments
Labels

Comments

@SlightlyDave
Copy link

Hi,

When running the migrator for a project that contains elements which are placed in the entry point into the API just before the apikit element causes a java.lang.StackOverflowError, removing these tags from the source API allows the migration tool to complete correctly.

The command line that was used:

java -jar mule-migration-assistant-runner-1.1.0.jar -projectBasePath C:\MuleSoft\Mule3to4Projects\Mule3Api -parentDomainBasePath C:\MuleSoft\Mule3to4Projects\Mule3Domain -muleVersion 4.3.0 -destinationProjectBasePath C:\MuleSoft\Mule4Projects\Mule4Api

Example Code:

`

    <http:listener config-ref="Ref" path="${api.http.listener.path}" doc:name="HTTP" >
    </http:listener>

    <set-property propertyName="vTimeStamp" value="#[server.dateTime.format('YYYY-MM-dd HH:mm:ss,S')]" doc:name="Set TimeStamp"/>
    
	<response>
		<set-property propertyName="vTimeStamp" value="#[server.dateTime.format('YYYY-MM-dd HH:mm:ss,S')]" doc:name="Set TimeStamp"/>
	</response>


    <apikit:router config-ref="api-config" doc:name="APIkit Router" />
    <exception-strategy ref="global-exception-strategy" doc:name="Reference Exception Strategy" />
</flow>`

Command output:

Executing migrator 1.1.0... Exception in thread "main" java.lang.StackOverflowError at org.jdom2.Content.getDocument(Content.java:231) at org.jdom2.Content.getDocument(Content.java:231) at com.mulesoft.tools.migration.step.util.XmlDslUtils.isTopLevelElement(XmlDslUtils.java:501) at com.mulesoft.tools.migration.library.apikit.steps.ApikitHttpListenerMapping.getParentFlow(ApikitHttpListenerMapping.java:95) at com.mulesoft.tools.migration.library.apikit.steps.ApikitHttpListenerMapping.getParentFlow(ApikitHttpListenerMapping.java:103) at com.mulesoft.tools.migration.library.apikit.steps.ApikitHttpListenerMapping.getParentFlow(ApikitHttpListenerMapping.java:103)

Last line repeats 1020 times.

@holiday-sunrise
Copy link
Contributor

Same to us

@mlischetti
Copy link
Contributor

Hi @SlightlyDave the example code seems to be broken.
Can you please try to isolate the issue in a simple Mule 3 app and add the example to the issue so that it can be reproduced?

afelisatti pushed a commit that referenced this issue Jul 20, 2021
@afelisatti afelisatti changed the title Migrator 1.1.0 Response element (<response></response>) causes Stack Overflow Error Response element (<response>) causes StackOverflow when used above Apikit router Jul 20, 2021
@afelisatti afelisatti added the bug label Jul 21, 2021
@holiday-sunrise
Copy link
Contributor

how can i upload a example app

@holiday-sunrise
Copy link
Contributor

migration.log
mma-456-test-api.zip

MMA Snapshot 1.1.1 Master Branch

@afelisatti
Copy link

Thanks, @holiday-sunrise! The app is consistent with what we observed. We will review your pull request soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants