indy icon indicating copy to clipboard operation
indy copied to clipboard

Reflective call Warning due to Weld -> ClassFileWriter

Open whitingjr opened this issue 4 years ago • 3 comments

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 avatar Mar 10 '20 21:03 whitingjr

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 avatar Mar 11 '20 11:03 whitingjr

JEP 396 hints at the intention to encapsulate by default.

whitingjr avatar Dec 02 '20 17:12 whitingjr

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.

whitingjr avatar Dec 03 '20 12:12 whitingjr