-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
ClassLoader can't find resource since 2.7.0 #23511
Comments
cc @aloubyansky |
Sure, if the path argument uses
|
@aloubyansky I'm a bit confused, I see |
The property, right. The config option is mapped to |
Thanks for reporting the issue @camboui |
You're welcome :) I still can't figure out what changed between 2.6.3 and 2.7.0 to break this, even after some source diving and diff matching. I can't sleep with it ! Do you have a any clue ? (If you don't have time, don't bother 😉 ) |
As you noticed we have a new ClassPathElement implementation in 2.7 which pretty much replaces Jar- and Directory- ClassPathElement impl. And now we appear to be more strict when it comes to the resource names. So it's a bug in the VertxHttpRecorder that is calling |
Describe the bug
Hi,
After updating from 2.6.3-Final to 2.7.0-FInal, I've been trying to load a certificate file with property:
quarkus.http.ssl.certificate.file=META-INF/certs/server.pem
(I know it's deprecated)but it ended with a "FileNotFoundException".
After digging a bit, using this property then calls
Thread.currentThread().getContextClassLoader().getResourceAsStream(path);
in VertxHttpRecorder.javaI used this same code in a simple OnStart and observed the same behaviour.
I tried to dig further using debgger but only found that getResourceAsStream() from QuarkusClassLoader.java behaviour differs :
- 2.6.3 : 'elements' property contains [MemoryClassPathElement, DirectoryClassPathElement]
- 2.7.0 : 'elements' property contains [MemoryClassPathElement, PathTreeClassPathElement]
Expected behavior
File's loaded
Actual behavior
File's not found, FileNotFoundException
How to Reproduce?
1 - Download default zip from https://code.quarkus.io/
2 - Add class
3 - Add any file in resources directory, "META-INF/certs/server.pem"
4 - Switch from version 2.6.3-Final and 2.7.0-Final to observe that
inputStream
is null in 2.7.0-Final.Output of
uname -a
orver
Windows 10
Output of
java -version
openjdk 11.0.10 2021-01-19
GraalVM version (if different from Java)
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4
Additional information
No response
The text was updated successfully, but these errors were encountered: