Skip to content

Reflective call Warning due to Weld -> ClassFileWriter #1542

Open

Description

@whitingjr

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.

Activity

  1. whitingjr commented on Mar 11, 2020

    @whitingjr
    ContributorAuthor

    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!

  2. whitingjr commented on Dec 2, 2020

    @whitingjr
    ContributorAuthor

    JEP 396 hints at the intention to encapsulate by default.

  3. whitingjr commented on Dec 3, 2020

    @whitingjr
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions