Skip to content

Commit

Permalink
Fix jetty redeploy with custom jetty-env.xml
Browse files Browse the repository at this point in the history
Redeploy would fail because runner classloader is separate from the
servlet container classloader. So runner was not able to create new WebAppContext.
  • Loading branch information
aindlq committed May 9, 2024
1 parent c69f1dc commit fbbc2d3
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,15 @@ final class Runner {
}
}
else if (data.startsWith('redeploy ')) {
List<String> webappList = data.replace('redeploy ', '').split(' ').toList()
serverManager.redeploy(webappList)
writer.writeMayFail('redeployed')
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader()
Thread.currentThread().setContextClassLoader(cl)
try {
List<String> webappList = data.replace('redeploy ', '').split(' ').toList()
serverManager.redeploy(webappList)
writer.writeMayFail('redeployed')
} finally {
Thread.currentThread().setContextClassLoader(oldClassLoader)
}
}
}
} finally {
Expand Down

0 comments on commit fbbc2d3

Please sign in to comment.