Skip to content

Resolve hang in failure scenario #373

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

Merged
merged 1 commit into from
Sep 5, 2022

Conversation

cab105
Copy link
Contributor

@cab105 cab105 commented Sep 3, 2022

Experienced a hang while attempting to use the spring-boot-migrator to convert a Mule project to Spring Boot. Tracing the hang resulted in a failure occurring within the program itself, and rather than indicating the failure, spring-boot-migrator locked itself into an infinite loop where issuing a SIGINT from the console wasn't enough.

This fix converts the while check to an if check to ensure that the failure message gets printed, and the program can return a prompt.

@sanagaraj-pivotal
Copy link
Contributor

Hello @cab105 welcome to Spring-boot-migrator team, we recently had a stab at solving this issue with one of our open rewrite based recipes.

Could you provide us a sample small mule project that exhibits this behaviour? or try latest SBM on your sample

@fabapp2 fabapp2 merged commit 2916ba5 into spring-projects-experimental:main Sep 5, 2022
@fabapp2
Copy link
Contributor

fabapp2 commented Sep 5, 2022

Thanks @cab105 🚀

I am sorry you had to dig into this area of the code ;)
As @sanagaraj-pivotal wrote, an example project would be great?
Nevertheless, I merged it.

@cab105
Copy link
Contributor Author

cab105 commented Sep 5, 2022

Thank you @fabapp2 and @sanagaraj-pivotal.

For context this is against the latest source tree, and with this "fix" in place, I'm able to get a proper failure scenario with stacktrace using stacktrace from the CLI. I am seeing the following error being thrown:
Caused by: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0 this is occurring at

JavaSourceSet mainJavaSourceSet = projectContext.getApplicationModules().getTopmostApplicationModules().get(0).getMainJavaSourceSet();
.

I'm still digging into the underlying failure to determine why it isn't locating the application context as this is blocking the other PR I'm working on.

As to the sample that I've been using for my own development/testing, it is this:
https://gist.github.com/cab105/be696eca9380b751219f6395febf6afb

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

Successfully merging this pull request may close these issues.

3 participants