Skip to content

Commit

Permalink
Jetty 11: Load servlet classes via app class loader (fixes webhost in…
Browse files Browse the repository at this point in the history
…tegration test)
  • Loading branch information
f4lco committed Nov 13, 2020
1 parent ed5c926 commit 9d4bc4b
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,16 @@ class JettyConfigurerImpl implements JettyConfigurer {
include 'groovyx.'
})

context.addSystemClassMatcher(new ClassMatcher().tap {
// I do not know if the servlet classes are system classes in the truest sense.
// However, those must be loaded by the app class loader. Otherwise the check in
// org.eclipse.jetty.servlet.ServletHolder#checkServletType does not succeed, because
// class HttpServlet (loaded from the web app class loader) is not assignable to class
// HttpServlet (loaded from the app class loader). Hence the error message 'YourServlet
// is not a Jakarta servlet'.
include 'jakarta.'
})

return context
}

Expand Down

0 comments on commit 9d4bc4b

Please sign in to comment.