-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
BugFor general bugs on Jetty sideFor general bugs on Jetty sideMicrosoft WindowsFor issues unique to Microsoft WindowsFor issues unique to Microsoft Windows
Description
Jetty version(s)
Jetty 12.1.1
Jetty Environment
core
Java version/vendor (use: java -version)
openjdk-24.0.+12-54 x86-64
OS type/version
Windows 11
Description
The CONTAINER_JAR_PATTERN setting is ignored on Windows.
Upon further debugging, the problem is as follows:
MetaInfConfiguration.findAndFilterContainerPaths()
is called, which in turn callsResourceFactory.split()
to split upjava.class.path
.ResourceFactory.split()
however always returns an empty list on Windows. The reason is thatURIUtil.hasScheme()
returns true forC:\foo\bar
, causing the follow-upnew URI()
to throw an exception (sinceC:\foo\bar
isn't a parsable URI).
How to reproduce?
final WebAppContext context = new WebAppContext();
final Resource webRoot = findWebRoot(context.getResourceFactory().newResource("C:\\"));
context.setBaseResource(webRoot);
context.setContextPath("/");
context.setAttribute(MetaInfConfiguration.CONTAINER_JAR_PATTERN, ".*\\.jar|.*/classes/.*");
context.setConfigurationDiscovered(true);
var server = new Server();
server.setHandler(context);
server.start();
On Linux, classpath is properly scanned, servlets are auto-discovered and activated. On Windows, no servlets are auto-discovered.
Metadata
Metadata
Assignees
Labels
BugFor general bugs on Jetty sideFor general bugs on Jetty sideMicrosoft WindowsFor issues unique to Microsoft WindowsFor issues unique to Microsoft Windows
Type
Projects
Status
🏗 In progress