Skip to content
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

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

Open
cliviu opened this issue Sep 18, 2024 · 7 comments · May be fixed by #12287
Open

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

cliviu opened this issue Sep 18, 2024 · 7 comments · May be fixed by #12287
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@cliviu
Copy link

cliviu commented Sep 18, 2024

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.

@cliviu cliviu added the Bug For general bugs on Jetty side label Sep 18, 2024
@joakime
Copy link
Contributor

joakime commented Sep 18, 2024

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.

  • It can only be at the end of a String.
  • It must be after a directory slash.
  • Only a "*" is supported (meaning all files in the current directory)

@cliviu
Copy link
Author

cliviu commented Sep 18, 2024

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
Copy link
Author

cliviu commented Sep 18, 2024

Now I see that the issue is older : #11092 .

@joakime
Copy link
Contributor

joakime commented Sep 18, 2024

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

@joakime
Copy link
Contributor

joakime commented Sep 18, 2024

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

@joakime joakime self-assigned this Sep 18, 2024
@cliviu
Copy link
Author

cliviu commented Sep 19, 2024

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

When will be the next version available?

@joakime
Copy link
Contributor

joakime commented Sep 19, 2024

When will be the next version available?

Jetty 12 release cadence is to stage the next release at the last thursday of every month, then once testing of the stage is complete release it. Sometimes it goes quick, sometimes it takes longer when the stage testing fails (we have to restage after fixing what we discover, etc)

When it is staged, would be a good time to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
Status: 🏗 In progress
2 participants