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 jetty redeploy with custom jetty-env.xml #304

Merged
merged 1 commit into from
May 20, 2024

Conversation

aindlq
Copy link

@aindlq aindlq commented May 9, 2024

Redeploy would fail because runner classloader is separate from the servlet container classloader. So runner was not able to create new WebAppContext.

Redeploy would fail because runner classloader is separate from the
servlet container classloader. So runner was not able to create new WebAppContext.
@f4lco
Copy link
Collaborator

f4lco commented May 10, 2024 via email

@boris-petrov
Copy link
Member

That makes sense to me. It's similar to 0126e07. Perhaps the:

ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader()
Thread.currentThread().setContextClassLoader(cl)
try {
  ...
}
finally {
  Thread.currentThread().setContextClassLoader(oldClassLoader)
}

Logic can be extracted in a method - I see it's already used in 3 other places.

@boris-petrov boris-petrov requested a review from f4lco May 14, 2024 03:13
Copy link
Collaborator

@f4lco f4lco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

@f4lco f4lco merged commit 428d42a into gretty-gradle-plugin:gretty-3.x May 20, 2024
4 checks passed
f4lco pushed a commit that referenced this pull request May 20, 2024
Redeploy would fail because runner classloader is separate from the
servlet container classloader. So runner was not able to create new WebAppContext.
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