Quarkus: Remove in RESTEasy causes for WARNING: An illegal reflective access operation has occurred

Created on 2 Jun 2020  路  16Comments  路  Source: quarkusio/quarkus

2020-06-02 19:26:13,387 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [agroal, cdi, hibernate-orm, hibernate-orm-panache, hibernate-validator, jdbc-mysql, narayana-jta, rest-client, resteasy, resteasy-jackson, smallrye-context-propagation, smallrye-fault-tolerance, smallrye-health, smallrye-openapi, swagger-ui]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jboss.resteasy.microprofile.client.header.ComputedHeaderValueFiller (jar:file:/Users/sam/.m2/repository/org/jboss/resteasy/resteasy-client-microprofile/4.5.3.Final/resteasy-client-microprofile-4.5.3.Final.jar!/) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class)
WARNING: Please consider reporting this to the maintainers of org.jboss.resteasy.microprofile.client.header.ComputedHeaderValueFiller
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

I am facing this warnings with JDK 11.

All 16 comments

@kenfinnigan @asoldano I think that the method handle in ComputedHeaderValueFiller is causing more trouble than it's worth.
I am correct in my assumption that it was added in order to improve performance?

Possibly, @michalszynkiewicz might recall the original reason as he was the author.

We do remove the method for native image via substitution, so could consider removing it

I saw it's removed in native :+1: .
Given the ugly warning it gives in JVM, I would be in favor of removing it totally.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.eclipse.yasson.internal.ReflectionUtils (jar:file:/Users/edufolly/.gradle/caches/modules-2/files-2.1/org.eclipse/yasson/1.0.7/feea69b46df5891c9e76f4eb387285b8520f885b/yasson-1.0.7.jar!/) to constructor java.util.AbstractCollection()
WARNING: Please consider reporting this to the maintainers of org.eclipse.yasson.internal.ReflectionUtils
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

It appears with this simple query.

public List<T> getAll() {
    PanacheQuery<T> query = this.find("deletedAt = ?1", Config.NOT_DELETED);
    return query.list();
}

uname -a

Darwin MacBook-Pro-de-Eduardo.local 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar  4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64

java -version

openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02)
OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing)

@edufolly that is a different manifestation. I suggest you report that to Eclipse Yasson since the fix would need to be made there

@geoand did you know what is the dependency for this library? Because I didn't add Yasson to the project.

Would you have any clue?

    implementation 'io.quarkus:quarkus-jdbc-postgresql'
    implementation 'io.quarkus:quarkus-hibernate-orm-panache'
    implementation 'io.quarkus:quarkus-resteasy-jsonb'
    implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
    implementation 'io.quarkus:quarkus-resteasy'

    testImplementation 'io.quarkus:quarkus-junit5'
    testImplementation 'io.rest-assured:rest-assured'

Eclipse Yasson is the implementation of Jsonb that we use.

So in your case quarkus-resteasy-jsonb brings it in

@geoand thanks for your support.

https://github.com/eclipse-ee4j/yasson/issues/412

Great, thanks!

@kenfinnigan do default methods work without the handle?
I think the reason for adding it was that they don't.
But maybe there's a different way of making them work without MethodHandle

That might be why they're there, but we remove the call when in native, so they must still work?

Does the TCK test default methods, does it pass?

do we run TCK against native?

Don't think so, so it might be an issue waiting to happen

Is that something that could be addressed for 1.7 ?

I don't think so. @michalszynkiewicz has a fix but it depends on: https://github.com/resteasy/Resteasy/pull/2476

On Quarkus 1.8.1 we are still seeing this error. Now that the mentioned issue is fixed at resteasy, can this also be fixed in Quarkus?

Was this page helpful?
0 / 5 - 0 ratings