-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
No jars added when using a folder in extraClasspath of the webapp context xml file #5129
Comments
The protocol error is new.
As a result of this filed issue I tried it out.
They all fail in the same way ...
The JARs were added to the WebAppClassLoader, but the attempt to discover the canonical path triggered an Exception. I get the same exception on all versions of Java I've tested on this machine ...
However, I don't get the exception if I test the same thing on other laptops.
This seems to be a quirk in NTFS specifically. |
As a workaround, you can use URI syntax instead. So change this ... <Set name="extraClasspath">E:\path\to\libs\*</Set> to <Set name="extraClasspath">file:///e:/path/to/libs/*</Set> and it will use a different path within Jetty to resolve those libs. |
Thnx for the quick response, it works with the workaround ! |
This is a revival of Issue #3489 Seems that this new one is now triggering in the WebInfConfiguration |
+ More tests for both relative and absolute path references + More testing that will trigger quirks on Windows builds so that we can catch regressions faster + Reworked WebInfConfiguration to be glob aware in a way similar to how WebAppClassLoader behaves. + Reworked Resource.newResource(String) to delegate canonical path resolution to PathResource + Guarded PathResource's usage of Path.toAbsolutePath() to ignore valid conditions where the Path cannot be resolved to an absolute path (yet)
Opened PR #5131 |
Signed-off-by: Joakim Erdfelt <[email protected]>
Signed-off-by: Joakim Erdfelt <[email protected]>
+ More tests for both relative and absolute path references + More testing that will trigger quirks on Windows builds so that we can catch regressions faster + Reworked WebInfConfiguration to be glob aware in a way similar to how WebAppClassLoader behaves. + Reworked Resource.newResource(String) to delegate canonical path resolution to PathResource + Guarded PathResource's usage of Path.toAbsolutePath() to ignore valid conditions where the Path cannot be resolved to an absolute path (yet) + Normalize resolved paths in PathResource Signed-off-by: Joakim Erdfelt <[email protected]>
+ Introduce new Resource.fromReferences to help with parsing delimited resource reference lists. Signed-off-by: Joakim Erdfelt <[email protected]>
Signed-off-by: Joakim Erdfelt <[email protected]>
Signed-off-by: Joakim Erdfelt <[email protected]>
+ Will migrate to jetty-10.0.x Signed-off-by: Joakim Erdfelt <[email protected]>
Signed-off-by: Joakim Erdfelt <[email protected]>
…-glob Issue #5129 - WebAppContext.setExtraClasspath(String) cleanup
Merged PR #5131 to |
Jetty version
9.4.31.v20200723
Java version
jvm 1.8.0_231-b11
OS type/version
Windows 10 64-bit
Description
I have a folder with a couple of jars:
E:\path\to\libs\jar1.jar
E:\path\to\libs\jar2.jar
In my webapp context xml file, I have this line:
<Set name="extraClasspath">E:\path\to\libs\</Set>
I am starting the server with this command:
java -Dorg.eclipse.jetty.webapp.WebAppClassLoader.LEVEL=DEBUG -jar start.jar
The server starts correctly and shows this line:
2020-08-07 10:26:39.055:DBUG:oejw.WebAppClassLoader:main: Path resource=file:///E:/path/to/libs/
But it does not add the jars in the folder.
If I change the extraClasspath to:
<Set name="extraClasspath">E:\path\to\libs\*</Set>
It shows the following lines when the server is starting:
2020-08-07 10:33:10.114:DBUG:oejw.WebAppClassLoader:main: Glob Path resource=file:///E:/path/to/libs/
2020-08-07 10:33:10.118:DBUG:oejw.WebAppClassLoader:main: addJar - file:///E:/path/to/libs/jar1.jar
2020-08-07 10:33:10.119:DBUG:oejw.WebAppClassLoader:main: Path resource=file:///E:/path/to/libs/jar1.jar
2020-08-07 10:33:10.121:DBUG:oejw.WebAppClassLoader:main: addJar - file:///E:/path/to/libs/jar2.jar
Then shows the following exception:
java.io.IOException: Invalid argument
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.WinNTFileSystem.canonicalize(Unknown Source)
at java.io.File.getCanonicalPath(Unknown Source)
at java.io.File.getCanonicalFile(Unknown Source)
at org.eclipse.jetty.util.resource.Resource.newResource(Resource.java:182)
at org.eclipse.jetty.util.resource.Resource.newResource(Resource.java:151)
at org.eclipse.jetty.server.handler.ContextHandler.newResource(ContextHandler.java:1968)
at org.eclipse.jetty.webapp.WebInfConfiguration.findExtraClasspathJars(WebInfConfiguration.java:950)
at org.eclipse.jetty.webapp.WebInfConfiguration.findJars(WebInfConfiguration.java:882)
at org.eclipse.jetty.webapp.WebInfConfiguration.findAndFilterWebAppPaths(WebInfConfiguration.java:294)
at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:145)
at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:488)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:523)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:46)
at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:188)
at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:513)
at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:154)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:173)
at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:447)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:66)
at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:784)
at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:753)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:641)
at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:540)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:146)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:599)
at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:249)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
at org.eclipse.jetty.server.Server.start(Server.java:408)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
at org.eclipse.jetty.server.Server.doStart(Server.java:372)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
at org.eclipse.jetty.xml.XmlConfiguration.lambda$main$1(XmlConfiguration.java:1929)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1878)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jetty.start.Main.invokeMain(Main.java:218)
at org.eclipse.jetty.start.Main.start(Main.java:491)
at org.eclipse.jetty.start.Main.main(Main.java:77)
Suppressed:
|java.net.MalformedURLException: unknown protocol: e
| at java.net.URL.(Unknown Source)
| at java.net.URL.(Unknown Source)
| at java.net.URL.(Unknown Source)
| at org.eclipse.jetty.util.resource.Resource.newResource(Resource.java:169)
| at org.eclipse.jetty.util.resource.Resource.newResource(Resource.java:151)
| at org.eclipse.jetty.server.handler.ContextHandler.newResource(ContextHandler.java:1968)
| at org.eclipse.jetty.webapp.WebInfConfiguration.findExtraClasspathJars(WebInfConfiguration.java:950)
| at org.eclipse.jetty.webapp.WebInfConfiguration.findJars(WebInfConfiguration.java:882)
| at org.eclipse.jetty.webapp.WebInfConfiguration.findAndFilterWebAppPaths(WebInfConfiguration.java:294)
| at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:145)
| at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:488)
| at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:523)
| at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
| at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:46)
| at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:188)
| at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:513)
| at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:154)
| at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:173)
| at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:447)
| at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:66)
| at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:784)
| at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:753)
| at org.eclipse.jetty.util.Scanner.scan(Scanner.java:641)
| at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:540)
| at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
| at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:146)
| at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
| at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:599)
| at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:249)
| at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
| at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
| at org.eclipse.jetty.server.Server.start(Server.java:408)
| at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
| at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
| at org.eclipse.jetty.server.Server.doStart(Server.java:372)
| at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
| at org.eclipse.jetty.xml.XmlConfiguration.lambda$main$1(XmlConfiguration.java:1929)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1878)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
| at java.lang.reflect.Method.invoke(Unknown Source)
| at org.eclipse.jetty.start.Main.invokeMain(Main.java:218)
| at org.eclipse.jetty.start.Main.start(Main.java:491)
| at org.eclipse.jetty.start.Main.main(Main.java:77)
The text was updated successfully, but these errors were encountered: