Skip to content

Commit

Permalink
Fix jetty redeploy with custom jetty-env.xml (#304)
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 authored and f4lco committed May 20, 2024
1 parent 7307559 commit d97a2da
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 d97a2da

Please sign in to comment.