-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Native Compilation and --link-at-build-time #30528
Comments
What is the exact error is you use And what is the |
Related to #25526 |
@zakkak should we close this as a duplicate? |
Yes and no :) Yes: This is not actually a Quarkus issue. We need to write a guide about how to approach this kind of issues and point people to it. No: #25526 is a feature request for allowing users to bypass such issues, which is something we would like them to do only as a last resort. So in that sense this issue is not a duplicate per se. In the lack of a proper guide on how to approach this I suggest we keep this open and help @hernael find a fix. |
The error mentioned in first comment is error exact that is thrown with those arguments: The native command is:
Important note, before updating there were no errors! and I used: quarkus.platform.version: 2.13.2.Final I just made a change of quarkus and native compiler. Maybe the problem is mandrel |
I don't know how 21.3 would work, but if I were you, I would look to your application, its dependencies and see why the jar containing No idea where you got the clue to add the A preferred approach might be to pass in |
@galderz for some unknown reason, when i add the oracle dependency (quarkus-reactive-oracle-client), quarkus doesn't add It's like Change |
@zakkak I have a very similar issue (details are in zulip). In my case, a constructor is not found. I have verified that the class is on the classpath ( |
@turing85 you might be hitting the issue I describe in oracle/graal#4661, i.e., the error you are seeing might be missleading and the actual issue is different. |
Hmm, so you are using Quarkus Edit: The original report mentions 22.3 GraalVM/Mandrel. It would be good to know which it is :) |
Just a clarification for the record. For Quarkus 2.13.0 -- 2.13.3 it's actually recommended to use GraalVM/Mandrel 21.3 or 22.2. For 2.13.4 onwards, it's recommended to use 22.3. See https://github.com/graalvm/mandrel/wiki. That being said, it's always recommended to use the latest release. Both 2.13.2 and 21.3 are outdated at this point, so please consider updating to Quarkus 2.13.7 or later and GraalVM/Mandrle 22.3 regardless of this issue. |
@hernael is this still an issue for you? |
I have the same issue: com.pengrad.telegrambot.impl.TelegramBotClient is registered for linking at image build time by command line Running: GraalVm: 22.3.r19-grl |
Hi @zakkak |
@hernael and @luis-rabock did you try following the short guide in https://quarkus.io/version/main/guides/native-reference#i-get-a-analysiserrorparsingerror-when-building-a-native-executable-due-to-an-unresolvedelementexception-what-can-i-do ? If not, please do. Thanks |
@luis-rabock Please open a different issue to avoid creating confusion. @hernael Please follow @zakkak's advice. Also, you still didn't provide the error(s) you get when you pass in |
@zakkak and @galderz adding My application only works if The problem is that currently quarkus almost always adds |
@hernael Can you please let us know if you tried following the guide I mention in #30528 (comment) and #30528 (comment)? For further help (if the guide doesn't help you resolve the issue) we will also need a reproducer (i.e. a maven/gradle project reproducing the error). |
^ That sounds odd. By default GraalVM initializes classes at runtime unless you specify which classes to initialize at build time. What
That is not a "problem". It's designed that way. So far all the issues we are aware about build time initialized classes can be solved by marking the necessary classes to be initialized at runtime. To reiterate @zakkak said, we can't help further without a reproducer or some more tangible information from you (see previous comments). |
One more thing you can try if you're feeling adventurous: download a GraalVM 23.0 snapshot and run with |
@galderz that's not true. The build time initialization is done in quarkus/core/deployment/src/main/java/io/quarkus/deployment/steps/NativeImageFeatureStep.java Lines 98 to 99 in d08d31f
To my understanding this issue is not a run-time vs build-time initialization issue, but an incomplete classpath initialization issue. https://quarkus.io/version/main/guides/native-reference#i-get-a-analysiserrorparsingerror-when-building-a-native-executable-due-to-an-unresolvedelementexception-what-can-i-do is meant to help developers address such issues. |
Ah yes, thx for correcting me @zakkak :) |
@hernael Have you checked where the jar that contains |
Closing for lack of feedback |
@galderz @geoand Still have the same error when using: <dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>6.7.0</version>
</dependency> Error: Caused by: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: javax.ws.rs.core.Context. This error is reported at image build time
because class org.glassfish.jersey.inject.hk2.ContextInjectionResolverImpl is registered for linking at image build time by command line I tried to set
|
Actually, the new class initialization method is on by default on master graal master since today. You can wait a few days, download a nightly build from here and you don't have to pass any new parameters to try the new class initialization mechanism. |
Thx, i will try! |
Describe the bug
In native build process, quarkus add --link-at-build-time argument.
But in my case that argument throws:
error even stays if i add the property:
the way I got it NOT to be added
--link-at-build-time
argument to native build phase was to add a dependency:There must be a solution other than adding a dependency so that the
--link-at-build-time argument
is removed in native build.Expected behavior
No response
Actual behavior
No response
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
openjdk version "17.0.5"
GraalVM version (if different from Java)
mandrel-java17-22.3.0.1-Final
Quarkus version or git rev
2.16.0.CR1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.6
Additional information
No response
The text was updated successfully, but these errors were encountered: