jetty / jetty.project

Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more
https://eclipse.dev/jetty
Other
3.83k stars 1.91k forks source link

Cannot start embedded Jetty from an application that uses classpath wildcards #12283

Open cliviu opened 1 day ago

cliviu commented 1 day ago

Jetty version(s) 12.0.13

Jetty Environment ee10

Java version/vendor `

openjdk version "17.0.5" 2022-10-18 OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8) OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode, sharing)

OS type/version

Windows Server 2012

Description Cannot use embedded Jetty started from an application that uses classpath wildcards.

DEBUG:oejur.ResourceFactory:main: Input string cannot be converted to URI "D:\testlibs\*"

java.lang.IllegalArgumentException: Cannot be converted to URI at org.eclipse.jetty.util.resource.ResourceFactory.newResource(ResourceFactory.java:376) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) at org.eclipse.jetty.ee10.webapp.MetaInfConfiguration.findAndFilterContainerPaths(MetaInfConfiguration.java:173) at org.eclipse.jetty.ee10.webapp.MetaInfConfiguration.preConfigure(MetaInfConfiguration.java:99) at org.eclipse.jetty.ee10.webapp.Configurations.preConfigure(Configurations.java:487) at org.eclipse.jetty.ee10.webapp.WebAppContext.preConfigure(WebAppContext.java:457) at org.eclipse.jetty.ee10.webapp.WebAppContext.doStart(WebAppContext.java:498) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113) at org.eclipse.jetty.server.Handler$Abstract.doStart(Handler.java:491) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) at org.eclipse.jetty.server.Server.start(Server.java:624) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113) at org.eclipse.jetty.server.Handler$Abstract.doStart(Handler.java:491) at org.eclipse.jetty.server.Server.doStart(Server.java:565) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)

How to reproduce? Start an embedded Jetty from an application that uses classpath wildcards.

joakime commented 1 day ago

As far as I'm aware, that's not a valid classpath with globs.

"D:\testlibs*" // this isn't supported.
"D:\testlibs\*" // this should be supported.

Java places some restrictions on how you use wildcard / globs.

cliviu commented 1 day ago

I have updated the description, it was with a backslash at the end but the markdown syntax swallowed it. It is a valid classpath configuration, the applications starts with it.

cliviu commented 1 day ago

Now I see that the issue is older : https://github.com/jetty/jetty.project/issues/11092 .

joakime commented 1 day ago

I think I see where we can make an improvement in #11092

joakime commented 21 hours ago

I have a possibly fix in #12287 can you test it?

cliviu commented 7 hours ago

I have a possibly fix in #12287 can you test it?

When will be the next version available?