-
Notifications
You must be signed in to change notification settings - Fork 1.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
Agent omitted one reflection: javax.xml.stream.FactoryConfigurationError: Provider com.sun.xml.internal.stream.XMLInputFactoryImpl not found #1387
Comments
Are you sure you covered all relevant code paths with the agent? It seems a piece of code tries to load XMLInputFactoryImpl via Class#forName and XMLInputFactoryImpl is not in the native-image.
Could you please have a look whether XMLInputFactoryImpl is in the json reflection configuration file? If not, try to add it manually and try again. The mentioned Exception does not look like it is related to XMLInputFactoryImpl. It seems that there is an error processing ClassUtil, when getEnclosingMethod is invoked.
|
@SergejIsbrecht I'm certain that I covered all code paths with the agent. My tool takes all the methods declared in After I added the following configuration the code started to working:
It seems to me that it's then more an issue in |
I am also sure that the native image does what it is supposed to do. When there is no entry in the configuration file the class will not be included in the native image. Therefore you get a ClassNotFoundException during runtime. Could you generate a trace file when using the native agent? I will have a look at the src code of the agent and the class javax.xml.stream.FactoryFinder.getProviderClass(FactoryFinder.java:125), if source is available. Maybe the agent does not trace a certain method, which is used for reflection. But there would probably an open issue already. |
So I did some digging. This is the call, which will be done:
I did some testing with GraalVM R19 JVM with the agent, which calls simular code:
Execution: This will in turn generate following trace file:
It seems to work for Class#forName(LString;) and Class#forName(LString;ZLClassLoader). Maybe try to re-run with the GraalVM JVM with the agent and the trace being active, just like I did in the Execution example. |
@SergejIsbrecht After adding both failing and passing payload to agent the configuration produced by agent is valid. Thank you @SergejIsbrecht for you investigation. |
@cstancu @SergejIsbrecht I've forgotten to remove the following snippet from
Since the issue still exists I've reopened it. Here you can find a zipped
For some reason there are no corresponding reflection config for EDIT
I did not find any line regarding the |
Thank you for your report @FieryCod , and for your help @SergejIsbrecht . The case here is that the agent as well as |
@peter-hofer @SergejIsbrecht Thank you gentlemen. Could you please notify me when you'll finish the patch? |
After discussing with @christianwimmer , our approach is to designate |
@peter-hofer @cstancu any progress? |
@arodionov , should this work with your recent changes? |
@FieryCod Please check with the last |
With Woodstox as the StAX parser I run into the same issue:
I am using GraalVM 20.0.0:
|
@rsteppac For Woodstox ( |
And it is expected behavior that the agent misses non-default parsers? |
@peter-hofer , could you please respond? |
I assume that Woodstox classes (in particular, factory classes) are discovered and instantiated through system properties, property files or the service provider mechanism in |
I tried specific rules as well as what I hope to be a catch'em all rule, but it made no difference with regards to the Woodstox parser not being added to the generated
|
For Woodstox I had to manually add
Agent did not add them even with
|
I am seeing this issue when building a native image with Quarkus. I'm also trying to use Amazon SQS. The strange thing is, the native-image builds and runs fine when I use my local (OSX) environment. But when I build the image via Docker, I get this error. Following the guide at https://quarkus.io/guides/building-native-image edit: resolved in my case by forcing quarkus to build with GraalVM 20 by setting the following in It was working in my local OSX environment because I was using v20 there already. |
I believe the original issue is solved. @rsteppac , if this is still a problem, can you please open a separate issue (referring to this one)? A small reproducer would be welcome. |
Sorry for the late response. I have been travelling... Please go ahead and close the issue. If I encounter the issue again I can do as suggested and open a new issue referencing this one. |
@peter-hofer @arodionov We can close the issue. Works great. Sorry for the late response. |
Story
I introduced a new feature in my framework which allows to generate all configuration files using
native-graalvm-agent
. It works quite nice and I removed the majority of errors, but still I cannotfind a way to remove error provided below.
GraalVM version used:
graalvm-ce:19.0.2
Error message:
How to reproduce? (you will need: aws-cli, aws-sam, leiningen)
sqs-example
and runI think that the error might be connected with the warnings I receive from
native-graalvm-agent
:Steps to reproduce the warnings:
sqs-example
src/sqs_example/core.clj
put your url to sqsresources/envs.list
file and populate the configurationThe text was updated successfully, but these errors were encountered: