Skip to content
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

Reflective call Warning due to Weld -> ClassFileWriter #1542

Open
whitingjr opened this issue Mar 10, 2020 · 3 comments
Open

Reflective call Warning due to Weld -> ClassFileWriter #1542

whitingjr opened this issue Mar 10, 2020 · 3 comments

Comments

@whitingjr
Copy link
Contributor

Running a build shows a Warning for reflective calls.

Running org.commonjava.indy.rest.apigen.SwaggerExportTest
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jboss.classfilewriter.ClassFile$1 (file:/home/whitingjr/.m2/repository/org/jboss/weld/se/weld-se/2.4.6.Final/weld-se-2.4.6.Final.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of org.jboss.classfilewriter.ClassFile$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 12.27 sec - in org.commonjava.indy.rest.apigen.SwaggerExportTest

The current version of Weld uses a dependency called ClassFileWriter.
Reflective call has been fixed by replacing the offending call in PR#17.
That fix is available in tagged 1.2.4.
Weld tagged version 3.1.1.Final is the earliest version to include the classfilewriter fix.

When time permits the version of Weld should be version bumped to 3.1.1.Final.

@whitingjr
Copy link
Contributor Author

Here are a couple more cases where classfilewriter is used

Running org.commonjava.indy.revisions.RevisionsManagerTest
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jboss.classfilewriter.ClassFile$1 (file:/home/whitingjr/.m2/repository/org/jboss/weld/se/weld-se/2.4.6.Final/weld-se-2.4.6.Final.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of org.jboss.classfilewriter.ClassFile$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.395 sec - in org.commonjava.indy.revisions.RevisionsManagerTest

Running org.commonjava.indy.rest.apigen.SwaggerExportTest
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jboss.classfilewriter.ClassFile$1 (file:/home/whitingjr/.m2/repository/org/jboss/weld/se/weld-se/2.4.6.Final/weld-se-2.4.6.Final.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of org.jboss.classfilewriter.ClassFile$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 5.601 sec <<< FAILURE! - in org.commonjava.indy.rest.apigen.SwaggerExportTest
downloadApiFiles(org.commonjava.indy.rest.apigen.SwaggerExportTest) Time elapsed: 4.983 sec <<< ERROR!

@whitingjr
Copy link
Contributor Author

JEP 396 hints at the intention to encapsulate by default.

@whitingjr
Copy link
Contributor Author

whitingjr commented Dec 3, 2020

JEP 396 is proposed for JDK16. Making the migration to LTS version JDK17 a barrier.
The Weld project has ceased development of the 2.x versions. A proposal to version bump was rejected.
Instead Indy will need to be moved onto a version that is under active development. At this time that is 3. and 4.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant