Skip to content

[JBMAR-214] Java 9: Illegal reflective access to create OptionalDataException #191

@dmlloyd

Description

@dmlloyd

Philippe Marschall opened JBMAR-214 and commented

JBoss Marshalling performs illegal reflective access to create an instance of java.io.OptionalDataException. This happens in org.jboss.marshalling.Marshalling#createOptionalDataException. We get the following warning in our logs

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jboss.marshalling.Marshalling$OptionalDataExceptionCreateAction$1 (file:/home/user/.m2/repository/org/jboss/marshalling/jboss-marshalling-osgi/1.4.10.Final/jboss-marshalling-osgi-1.4.10.Final.jar) to constructor java.io.OptionalDataException(boolean)
WARNING: Please consider reporting this to the maintainers of org.jboss.marshalling.Marshalling$OptionalDataExceptionCreateAction$1

Depending on the JVM options, this may already throw an exception Java 9.

Oracle has stated that

When deny becomes the default illegal-access mode then permit will likely remain supported for at least one release, so that developers can continue to migrate their code. The permit, warn, and debug modes will, over time, be removed, as will the --illegal-access option itself.

http://openjdk.java.net/jeps/261#Relaxed-strong-encapsulation


Issue Links:

  • JBMAR-215 Java 9: Eliminate uses of reflection setAccessible()
    ("is incorporated by")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions