-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug fix to allow applications to add Jetty servlets and filters. #105
Conversation
Signed-off-by: Lachlan Roberts <[email protected]>
@@ -104,12 +106,21 @@ public void start(String serverInfo, ServletEngineAdapter.Config runtimeOptions) | |||
threadPool.setVirtualThreadsExecutor(VirtualThreads.getDefaultVirtualThreadsExecutor()); | |||
logger.atInfo().log("Configuring Appengine web server virtual threads."); | |||
} | |||
|
|||
// The server.getDefaultStyleSheet() returns is returning null because of some classloading issue, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you be either more or less vague than "some classloading issue"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turned this into a TODO to investigate why we need to do this, otherwise I could just remove the comment all together.
...l_jetty12/src/main/java/com/google/apphosting/runtime/jetty/ee10/AppEngineWebAppContext.java
Show resolved
Hide resolved
@lachlan-roberts the issue is that jetty-9 had a startWebapp() method that allowed interception of startup after metadata.resolve. |
@lachlan-roberts I have opened jetty/jetty.project#11553 |
...l_jetty12/src/main/java/com/google/apphosting/runtime/jetty/ee10/AppEngineWebAppContext.java
Show resolved
Hide resolved
…loading PiperOrigin-RevId: 627582402 Change-Id: Ib2ff3d4d9af285738adf92ffe3bc90014338982f
Jetty Servlets like the
DefaultServlet
require classes contained inruntime-impl-jetty12.jar
to run so it can't be done by the application classloader.The logic inside
AppEngineWebAppContext.startContext
is being run before the processing ofweb.xml
and so the Jetty servlets were not being instantiated. I used a hack with aListenerHolder.doStart
to get around this but maybe there is some better interception point for this.Also
server.getDefaultStyleSheet()
was returning null due to some classloader behaviour causing the default servlet not to start. So I also have a workaround for this.