fix(jetty12): throw fatal exception on missing or unavailable servlets during startup (#103)#517
Open
ludoch wants to merge 2 commits into
Open
fix(jetty12): throw fatal exception on missing or unavailable servlets during startup (#103)#517ludoch wants to merge 2 commits into
ludoch wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #103 across all Jetty 12 and Jetty 12.1 runtime and local dev modules (
runtime_impl_jetty12,runtime_impl_jetty121,local_jetty121, andlocal_jetty121_ee11).Problem
Previously, when a web application defined a nonexistent servlet class or encountered a startup initialization error (
ClassNotFoundException/UnavailableExceptioninweb.xml), Jetty 12 caught the exception and logged it as aWARNINGduringWebAppContext.doStart(). The application context would start up without failing, and only return HTTP 503 at runtime when requests hit the missing servlet.Solution
In
AppEngineWebAppContext.newServletHandler(), explicitly configuredhandler.setStartWithUnavailable(false)across all Jetty 12 / 12.1 contexts (ee8,ee10,ee11).Added strict inspection in
AppEngineWebAppContext.doStart()aftersuper.doStart(). If any registeredServletHolderor the context itself has caught anUnavailableException/ initialization error (holder.getUnavailableException() != null),doStart()re-throws it (IllegalStateException/ServletException) causing application startup to fail immediately and fatally.Added unit tests (
missingServletClassThrowsOnStartupEe8,missingServletClassThrowsOnStartupEe10,missingServletClassThrowsOnStartupEe11) inAppEngineWebAppContextTestacrossruntime_impl_jetty12andruntime_impl_jetty121verifying that deploying an application with a missing servlet class throws an exception duringdoStart().Testing
All unit test suites across
runtime_impl_jetty12,runtime_impl_jetty121,local_jetty121, andlocal_jetty121_ee11pass cleanly.