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 May 20, 2024
1 parent 806457e commit 428d42a
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 428d42a

Please sign in to comment.