You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have embedded jetty servers that use a shared resources "layer" packed as a jar.
The setup works as expected in Jetty 11, but an attempt to migrate to Jetty 12 leads to the following exception:
java.lang.NullPointerException: Cannot invoke "java.net.URI.toString()" because the return value of "org.eclipse.jetty.util.resource.Resource.getURI()" is null
at org.eclipse.jetty.ee10.webapp.JettyWebXmlConfiguration.setupXmlConfiguration(JettyWebXmlConfiguration.java:135) ~[jetty-ee10-webapp-12.0.16.jar:12.0.16]
at org.eclipse.jetty.ee10.webapp.JettyWebXmlConfiguration.configure(JettyWebXmlConfiguration.java:70) ~[jetty-ee10-webapp-12.0.16.jar:12.0.16]
at org.eclipse.jetty.ee10.webapp.Configurations.configure(Configurations.java:505) ~[jetty-ee10-webapp-12.0.16.jar:12.0.16]
at org.eclipse.jetty.ee10.webapp.WebAppContext.configure(WebAppContext.java:484) ~[jetty-ee10-webapp-12.0.16.jar:12.0.16]
at org.eclipse.jetty.ee10.webapp.WebAppContext.startContext(WebAppContext.java:1300) ~[jetty-ee10-webapp-12.0.16.jar:12.0.16]
at org.eclipse.jetty.ee10.servlet.ServletContextHandler.lambda$doStart$0(ServletContextHandler.java:1047) ~[jetty-ee10-servlet-12.0.16.jar:12.0.16]
at org.eclipse.jetty.server.handler.ContextHandler$ScopedContext.call(ContextHandler.java:1452) ~[jetty-server-12.0.16.jar:12.0.16]
at org.eclipse.jetty.ee10.servlet.ServletContextHandler.doStart(ServletContextHandler.java:1044) ~[jetty-ee10-servlet-12.0.16.jar:12.0.16]
at org.eclipse.jetty.ee10.webapp.WebAppContext.doStart(WebAppContext.java:503) ~[jetty-ee10-webapp-12.0.16.jar:12.0.16]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93) ~[jetty-util-12.0.16.jar:12.0.16]
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) ~[jetty-util-12.0.16.jar:12.0.16]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:120) ~[jetty-util-12.0.16.jar:12.0.16]
at org.eclipse.jetty.server.Handler$Abstract.doStart(Handler.java:491) ~[jetty-server-12.0.16.jar:12.0.16]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93) ~[jetty-util-12.0.16.jar:12.0.16]
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) ~[jetty-util-12.0.16.jar:12.0.16]
at org.eclipse.jetty.server.Server.start(Server.java:641) ~[jetty-server-12.0.16.jar:12.0.16]
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:120) ~[jetty-util-12.0.16.jar:12.0.16]
at org.eclipse.jetty.server.Handler$Abstract.doStart(Handler.java:491) ~[jetty-server-12.0.16.jar:12.0.16]
at org.eclipse.jetty.server.Server.doStart(Server.java:582) ~[jetty-server-12.0.16.jar:12.0.16]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93) ~[jetty-util-12.0.16.jar:12.0.16]
Looking further into Jetty codebase the exception happens in JettyWebXmlConfiguration:
because webInf is a CombinedResource and getURI returns null for it. Meanwhile, it looks like it's allowed and expected for webInf resource to be a CombinedResource based on the following comment from WebAppContext:
public Resource getWebInf() throws IOException
{
if (getBaseResource() == null)
return null;
// Is there a WEB-INF directory anywhere in the Resource Base?
// ResourceBase could be a CombinedResource
// The result could be a CombinedResource with multiple WEB-INF directories
// Can return from WEB-INF/lib/foo.jar!/WEB-INF
// Can also never return from a META-INF/versions/#/WEB-INF location
Resource webInf = getBaseResource().resolve("WEB-INF/");
if (Resources.isReadableDirectory(webInf))
return webInf;
return null;
}
This looks like a regression in a supported scenario from Jetty 11.
The text was updated successfully, but these errors were encountered:
@Spikhalskiy are you relying on the value of the properties that are set in JettyWebXmlConfiguration? If those properties were skipped if WEB-INF was a CombinedResource would that be a problem for you?
@janbartel I'm not sure I understand what scope of properties you mean, but the answer is likely yes, we are relying on them. We need at least "contextPath" from jetty-web.xml to get the correct bindings.
Jetty version(s)
Jetty 12.0.16 vs Jetty 11.0.24
Jetty Environment
EE 10
Description
We have embedded jetty servers that use a shared resources "layer" packed as a jar.
The setup works as expected in Jetty 11, but an attempt to migrate to Jetty 12 leads to the following exception:
Looking further into Jetty codebase the exception happens in
JettyWebXmlConfiguration
:because webInf is a
CombinedResource
andgetURI
returns null for it. Meanwhile, it looks like it's allowed and expected for webInf resource to be aCombinedResource
based on the following comment fromWebAppContext
:This looks like a regression in a supported scenario from Jetty 11.
The text was updated successfully, but these errors were encountered: