-
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
Reflection registration when building with native-sources #22590
Comments
/cc @Karm, @cescoffier, @galderz, @ozangunalp, @zakkak |
Renamed the issue, it's not related to Kafka. I don't see where we pass the reflection registration (including the ones for Kafka, but also all the other ones (JSON...) |
@geoand @stuartwdouglas any idea? |
The reflection registration information (along with a bunch of other stuff) is performed programmatically in the generated feature class, see |
Hum, does that work when you pass a reflection Config file too? |
You mean if the user configures a reflection config file? |
@geoand like this: The provided reflection-config is very minimal: |
And the problem is that this additional command line argument is not being passed to GraalVM? |
Ok, it's not that. I've removed the file and I still have the issue:
So, there is something not passed into native-sources. |
I'll have a look tomorrow |
The KafkaProcessor does register a type hierarchy:
If we could find a way to compare both "native" and "native-source" it would help us understand the difference. |
FWIW, the configuration files are passed to GraalVM. I'll have a look at what is going on in the generated feature |
The only way I can think of is to look at the generated private static void registerClass131(BeforeAnalysisAccess var0) {
try {
ClassLoader var1 = Thread.currentThread().getContextClassLoader();
Class var2 = Class.forName("javax.security.auth.spi.LoginModule", (boolean)0, var1);
Constructor[] var4 = var2.getDeclaredConstructors();
Method[] var5 = var2.getDeclaredMethods();
Field[] var8 = var2.getDeclaredFields();
Class[] var3 = new Class[]{var2};
RuntimeReflection.register(var3);
RuntimeReflection.register((Executable[])var4);
RuntimeReflection.register((Executable[])var5);
Version var6 = Version.getCurrent();
int[] var7 = new int[]{21};
if (var6.compareTo(var7) < 0) {
RuntimeReflection.register((boolean)0, var8);
} else {
RuntimeReflection.register((boolean)0, (boolean)0, var8);
}
} catch (Throwable var9) {
}
}
private static void registerClass132(BeforeAnalysisAccess var0) {
try {
ClassLoader var1 = Thread.currentThread().getContextClassLoader();
Class var2 = Class.forName("org.apache.kafka.common.security.plain.PlainLoginModule", (boolean)0, var1);
Constructor[] var4 = var2.getDeclaredConstructors();
Method[] var5 = var2.getDeclaredMethods();
Field[] var8 = var2.getDeclaredFields();
Class[] var3 = new Class[]{var2};
RuntimeReflection.register(var3);
RuntimeReflection.register((Executable[])var4);
RuntimeReflection.register((Executable[])var5);
Version var6 = Version.getCurrent();
int[] var7 = new int[]{21};
if (var6.compareTo(var7) < 0) {
RuntimeReflection.register((boolean)0, var8);
} else {
RuntimeReflection.register((boolean)0, (boolean)0, var8);
}
} catch (Throwable var9) {
}
}
private static void registerClass133(BeforeAnalysisAccess var0) {
try {
ClassLoader var1 = Thread.currentThread().getContextClassLoader();
Class var2 = Class.forName("org.apache.kafka.common.security.scram.ScramLoginModule", (boolean)0, var1);
Constructor[] var4 = var2.getDeclaredConstructors();
Method[] var5 = var2.getDeclaredMethods();
Field[] var8 = var2.getDeclaredFields();
Class[] var3 = new Class[]{var2};
RuntimeReflection.register(var3);
RuntimeReflection.register((Executable[])var4);
RuntimeReflection.register((Executable[])var5);
Version var6 = Version.getCurrent();
int[] var7 = new int[]{21};
if (var6.compareTo(var7) < 0) {
RuntimeReflection.register((boolean)0, var8);
} else {
RuntimeReflection.register((boolean)0, (boolean)0, var8);
}
} catch (Throwable var9) {
}
}
private static void registerClass134(BeforeAnalysisAccess var0) {
try {
ClassLoader var1 = Thread.currentThread().getContextClassLoader();
Class var2 = Class.forName("org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule", (boolean)0, var1);
Constructor[] var4 = var2.getDeclaredConstructors();
Method[] var5 = var2.getDeclaredMethods();
Field[] var8 = var2.getDeclaredFields();
Class[] var3 = new Class[]{var2};
RuntimeReflection.register(var3);
RuntimeReflection.register((Executable[])var4);
RuntimeReflection.register((Executable[])var5);
Version var6 = Version.getCurrent();
int[] var7 = new int[]{21};
if (var6.compareTo(var7) < 0) {
RuntimeReflection.register((boolean)0, var8);
} else {
RuntimeReflection.register((boolean)0, (boolean)0, var8);
}
} catch (Throwable var9) {
}
} |
What about the
With:
Maybe also the Elyton stuff, but the reproducer is a Gradle project, so it's hard for me to understand what's pulled. |
Very good question! Those are simply mapped to It seems like the reproducer is using an old Quarkus version that did not include #21809. Can you try with |
@cescoffier should we close this as |
@geoand I think so. |
@geoand / @cescoffier, bump version solves the issue! |
No problem! |
Hello, And I have following errors in AWS see here : Do you have a solution to build native aws-msk-iam-auth with quarkus? |
@cmtoan Have you succeed to make it work ? |
@jvdadda I didn't succeed to make it work. I used the mechanism SCRAM-SHA-512 instead. |
Describe the bug
I'm building quarkus native application in two different ways and one works properly and another one don't.
Ok
NOK
@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
Output of
uname -a
orver
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
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: