-
Notifications
You must be signed in to change notification settings - Fork 30
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
NoSuchFieldException Using Java 17 #157
Comments
Hi, is this linked to this SO question? Either way, I will take a look in the coming days - Weld 3 wasn't developed with Java 17 in mind back then but I don't think there is a reason why it shouldn't work. |
Yes this is the same question. Thanks a lot for taking a look! Since Wildfly 26 uses Weld 3.1.9 I think it is not so unusual to run it with Java 17... I am not quite sure why the stack trace is different, I testet a lot with different versions/variations the last days. Here is the complete stack trace I get with 2.0.2 and Java 17:
|
@jens-stahl the exception you showed is coming from a class( |
How would I override it for version 3.1.9.Final? I tried to define the dependency like this:
But still get the same error. |
Yes, that should do the trick; when you look at the dependency tree ( IIRC, you need to declare
|
Dependency tree looks like this: [INFO] +- org.jboss.weld.se:weld-se-core:jar:3.1.9.Final:test |
This is weird, you have 3.0.5.Final version of the |
You are correct! I have no idea why it is pulling an older version of weld-core-impl. If I explicitly define the following weld libs it is running! Thank you very much for your help, much appreciated!
|
You shouldn't need to explicitly write it all out . It might be worth looking deeper into your project config to figure out the discrepancies; but that's something I cannot help with.
Glad I could help :) |
Hello,
we are using
weld-junit5:2.0.2.Final
with Java 17.
After migration from Java 11 to Java 17 we get the following exception:
Caused by: java.lang.NoSuchFieldException: override
at java.base/java.lang.Class.getDeclaredField(Class.java:2610)
at org.jboss.weld.util.bytecode.ClassFileUtils$1.run(ClassFileUtils.java:59)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at org.jboss.weld.util.bytecode.ClassFileUtils.(ClassFileUtils.java:48)
... 70 more
I tried to include as mentioned in #80
org.jboss.weld.se
weld-se-core
3.1.9.Final
test
but it has no effect.
Does weld-junit5 in version 2.0.2 work with Java 17? This is our current set up.
(using wildfly 26 in production)
Thanks a lot for any feedback or help!
The text was updated successfully, but these errors were encountered: