-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
@QuarkusTest classloader problems when executing XPathFactory.newInstance() #8451
Comments
I wasn't able to reproduce this in a simple test. Perhaps you could provide a small reproducer? |
Hi @geoand, I've started a new project and wasn't able to reproduce also. I'm adding my libs one by one to check which one brings this problem. I'll let you know when done. Thanks. |
@geoand the problem happens when I add this dependency:
I'm checking here why. |
@geoand you can close this one. I've found the problem. This library brings xerces and xml apis also.
Thank you so much. |
Great! Thanks for looking into it |
@geoand I think I said you to close so earlier :) See what I'm getting now after this exclusion, when trying to parse my .xlsx file:
|
Reopening then 😎 |
There are also similar problems with We get no-such-method errors in certain builds (e.g. w/ Xerces present) for the above method. When packaging the apps to a fast-jar it appears as if the Quarkus Classloader will not always load from the "default" JRE library set. This is pretty clearly a bug in either the Quarkus build tooling and/or the Quarkus Classloader. Libraries available in the system JRE should, by definition, never throw a ClassNotFound or NoSuchMethod error... if they do, that ClassLoader is either "special" and shouldn't happen without explicit request and/or broken. Now interactions and behavior in native builds probably need very explicit definition in these cases. |
There is a chance that this is related to #40601. Linking it to double-check later. |
Hi guys, I've faced an issue when parsing a .xlsx file in my JUnit tests.
The problem is that an internal lib tries to call the following code:
XPathFactory.newInstance()
Suppose we have the followings scenarios:
The first one executes ok, the last one throws the error:
java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom
Both scenarios are in a class annotated with the
@QuarkusTest
Any ideas on how I can solve this?
Best.
The text was updated successfully, but these errors were encountered: