Skip to content

Stacktrace about Reflective setAccessible(true) is ugly and should be removed from the output. #857

@marco-brandizi

Description

@marco-brandizi

I'm switching to the latest version of Neo4j/Community and Java driver.

At some point, I get messages about Neo4j apparently probing the environment (see the attached log).

One of these end up with a quite ugly stacktrace starting from:

UnsupportedOperationException: Reflective setAccessible(true) disabled is ugly and should be removed from the output

After this, things seem to go ahead fine and my build succeeds, so the output above looks like a warning and noting is actually wrong, yet I expect it to confuse my end users.

It would be good if this output could be eliminated, eg, by intercepting the exception and reporting just a warning instead.

My understanding is also that setAccessible() has been disabled in most recent Java releases and it's not possible to use it anymore, so checking the running JVM version would allow for knowing this isn't available, without using the try/catch approach (if that's what the driver is doing, I haven't it clear).

Neo4j Version: 4.2.4 Community , Java Driver 4.2.3
Neo4j Mode: Single instance
Driver version: Java driver 4.2.3
Operating System: macOS 10.15.7 (but it's not relevant)
Java:

openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.10+9, mixed mode)

Moreover, see the attached file

Steps to reproduce

Just try mvn install for this project of mine, I guess any driver instantiation produces this.

Expected behavior

Should not yield that output that look like an error to the non-expert user.

Actual behavior

It yields an ugly stack trace that, at a first look, can easily been mistaken for an actual error. That's bad mostly because it will likely trigger unnecessary complaints from end users.

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