question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reflection registration when building with native-sources

See original GitHub issue

Describe the bug

I’m building quarkus native application in two different ways and one works properly and another one don’t.

Ok

FROM quay.io/quarkus/ubi-quarkus-mandrel:21.3-java11 AS build
...
RUN ./gradlew build -Dquarkus.package.type=native -Dquarkus.native.native-image-xmx=$BUILD_MEMORY

NOK

## Stage 1: build native sources
FROM gradle:7.3-jdk11 AS gradle-build
...
RUN gradle clean build -Dquarkus.package.type=native-sources


## Stage 2: build quarkus-native
FROM quay.io/quarkus/ubi-quarkus-mandrel:21.3-java11 AS native-build
...
RUN native-image $(cat native-image.args) -J-Xmx$BUILD_MEMORY

@cescoffier investigated this and it seems there are missing reflection needed by Kafka - link

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

Clone this

docker-compose up -d
docker logs -f app-ok
docker logs -f app-nok

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
geoandcommented, Jan 4, 2022

No problem!

2reactions
geoandcommented, Jan 4, 2022

What about the NativeImageSecurityProviderBuildItem ?

Very good question! Those are simply mapped to -H:AdditionalSecurityProviders on the command line.

It seems like the reproducer is using an old Quarkus version that did not include https://github.com/quarkusio/quarkus/pull/21809. Can you try with 2.6.1.Final? It should fix the problem by also including the proper -H:AdditionalSecurityProviders on the generated command.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tips for writing native applications - Quarkus
Quarkus makes registration of reflection in an extension a breeze by using ReflectiveClassBuildItem , thus eliminating the need for a JSON configuration file....
Read more >
Native Sources | Hitchhikers
Start Building For Free · Start Building For Free. Yext. Sign up. Log in. If you don't have an account, sign up here....
Read more >
Release Notes for Red Hat build of Quarkus 2.2
Extension registry for Red Hat build of Quarkus ... QUARKUS-1554 Fix reflections registration of constructors used in serialization.
Read more >
Android NDK: Using C/C++ Native Libraries to Write Android ...
If you don't have a build script for your native sources, ... that have been tweaked when creating this project are reflected here,...
Read more >
LG NANO75 2021 TV Review - RTINGS.com
The newer model has better reflection handling and a slightly updated user interface, ... LG NANO75 2021 Build quality picture.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found