import io.restassured.RestAssured;
public static main(String[] org) {
public static void main(String[] org) {
}
}
after running the above set with eclipse which includes the lib from restAssured, the result below will show up and still can't find the reason. Is there anyone able to resolve it?
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/Users/dampion/Tools/java-rest-assured/rest-assured-3/rest-assured-3.1.0-deps/groovy-2.4.12.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
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
Same error on Java 9.
Could this be due to the groovy version used? Could you try excluding groovy from rest-assured (see faq) and update to a newer version of groovy to see if it goes away?
@johanhaleby I upgraded the version of groovy I'm using locally from 2.4.12 (the version rest-assured depends on) to version 2.5.1 (the latest stable release of Groovy-all).
Here's my dependency tree showing the 2.4.12 getting overridden by the 2.5.1 dependency.
+--- io.rest-assured:rest-assured:3.1.0
| +--- org.codehaus.groovy:groovy-xml:2.4.12 -> 2.5.1
| | \--- org.codehaus.groovy:groovy:2.5.1
| +--- org.apache.httpcomponents:httpclient:4.5.3
| | +--- org.apache.httpcomponents:httpcore:4.4.6
| | \--- commons-codec:commons-codec:1.9 -> 1.11
| +--- org.apache.httpcomponents:httpmime:4.5.1
| | \--- org.apache.httpcomponents:httpclient:4.5.1 -> 4.5.3 (*)
| +--- org.hamcrest:hamcrest-core:1.3
| +--- org.hamcrest:hamcrest-library:1.3 (*)
| +--- org.ccil.cowan.tagsoup:tagsoup:1.2.1
| +--- io.rest-assured:json-path:3.1.0
| | +--- org.codehaus.groovy:groovy-json:2.4.12 -> 2.5.1
| | | \--- org.codehaus.groovy:groovy:2.5.1
| | \--- io.rest-assured:rest-assured-common:3.1.0
| | \--- org.apache.commons:commons-lang3:3.4
| \--- io.rest-assured:xml-path:3.1.0
| +--- org.codehaus.groovy:groovy-xml:2.4.12 -> 2.5.1 (*)
| +--- io.rest-assured:rest-assured-common:3.1.0 (*)
| +--- org.apache.commons:commons-lang3:3.4
| +--- org.ccil.cowan.tagsoup:tagsoup:1.2.1
| \--- javax.xml.bind:jaxb-api:2.2.12
\--- org.codehaus.groovy:groovy-all:2.5.1
+--- org.codehaus.groovy:groovy:2.5.1
+--- org.codehaus.groovy:groovy-ant:2.5.1
| +--- org.codehaus.groovy:groovy:2.5.1
| +--- org.apache.ant:ant:1.9.9
| | \--- org.apache.ant:ant-launcher:1.9.9
Still getting the same problem though.
I've spent all of 10 minutes looking into this, but I think this may be code inside of rest-assured that needs to be changed.
Here's another project that had the same issue. There's also a commit there showing how they fixed it.
https://github.com/jqno/equalsverifier/issues/183
The WARNING message I got from Groovy indicated a particular class and function call (AFAIK those $ are extra classes being created by Groovy to support clsoures and such).
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass$3$1
I did more poking around, if you add --illegal-access=debug to your JVM while invoking the unit tests you can see the stack traces for every illegal call. It's pretty verbose. Here's an example of one. My guess is by reading the trace that groovy is the "bad actor" here, but I don't know if that's because of the way groovy is being used in this case (as in there is a safe subset of groovy that is compatible with Java 9's moduling system), or if the underlying implementation of groovy simply can't be used on Java 9 and the fix must come from the Groovy authors themselves.
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass$1$1 (file:/home/sasquatch/.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy-all/2.4.6/478feadca929a946b2f1fb962bb2179264759821/groovy-all-2.4.6.jar) to field sun.net.spi.DefaultProxySelector.hasSystemProxies
at org.codehaus.groovy.reflection.CachedClass$1$1.run(CachedClass.java:55)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.codehaus.groovy.reflection.CachedClass$1.initValue(CachedClass.java:50)
at org.codehaus.groovy.reflection.CachedClass$1.initValue(CachedClass.java:48)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:49)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:36)
at org.codehaus.groovy.reflection.CachedClass.getFields(CachedClass.java:267)
at groovy.lang.MetaClassImpl.addFields(MetaClassImpl.java:2379)
at groovy.lang.MetaClassImpl.inheritFields(MetaClassImpl.java:2374)
at groovy.lang.MetaClassImpl.setupProperties(MetaClassImpl.java:2261)
at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:3299)
at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3263)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:254)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:285)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:295)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:261)
at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:877)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:125)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:166)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at io.restassured.internal.proxy.RestAssuredProxySelector.select(RestAssuredProxySelector.groovy:38)
at org.apache.http.impl.conn.ProxySelectorRoutePlanner.determineProxy(ProxySelectorRoutePlanner.java:186)
at io.restassured.internal.proxy.RestAssuredProxySelectorRoutePlanner.determineProxy(RestAssuredProxySelectorRoutePlanner.java:49)
at org.apache.http.impl.conn.ProxySelectorRoutePlanner.determineRoute(ProxySelectorRoutePlanner.java:137)
at org.apache.http.impl.client.DefaultRequestDirector.determineRoute(DefaultRequestDirector.java:761)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:380)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at org.apache.http.client.HttpClient$execute$0.call(Unknown Source)
Okay, finally it looks like this is a Groovy-specific problem that they're working on. I don't think there's anything you can do to fix it @johanhaleby. Problematically this will break Rest Assured at some arbitrary Java JDK release in the future.
Multiple Groovy issues (e.g. mentioned GROOVY-8339 and GROOVY-9070 or GROOVY-8843 are already CLOSED.
Unfortunately, similar problem occurs on REST Assured 4.0.0 with OpenJDK-11.0.2:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (...../.gradle/caches/modules-2/files-2.1/org.codehaus.groovy/groovy/2.5.6/6936e700f0fb1b50bac0698ada4347a769d40199/groovy-2.5.6.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$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
Do you have any update from REST Assured point of view?
Two of these are marked as fixed in Groovy 3.0 alpha/beta
I don't expect REST assured will do anything until Groovy 3.0 has an
official release.
On Fri, Jul 12, 2019 at 3:57 AM Lubomir Elko notifications@github.com
wrote:
Multiple Groovy issues (e.g. mentioned GROOVY-8339
https://issues.apache.org/jira/browse/GROOVY-8339 and GROOVY-9070
https://issues.apache.org/jira/browse/GROOVY-9070 or GROOVY-8843
https://issues.apache.org/jira/browse/GROOVY-8843 are already CLOSED.
Do you have any update from REST Assured point of view?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/rest-assured/rest-assured/issues/1027?email_source=notifications&email_token=AAWEVVHP7MO2S5VEW47JBH3P7A2M5A5CNFSM4FEQVIQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZZANIQ#issuecomment-510789282,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWEVVGDHS7EEIP7FVPBJXDP7A2M5ANCNFSM4FEQVIQA
.
I get this warning on Java 11. Using rest-assured 4.2.0 with dependency to groovy 2.5.9. Groovy 3.0.0 is available since feb. Will rest-assured be updated shortly?
For people who searching for an answer. Start from version 4.3.0 RestAssured have upgraded from groovy 2.5.7 to 3.0.* (check their changelog here)
It fixes that annoying warning when you're running your app on jvm11 or above
Most helpful comment
Two of these are marked as fixed in Groovy 3.0 alpha/beta
I don't expect REST assured will do anything until Groovy 3.0 has an
official release.
On Fri, Jul 12, 2019 at 3:57 AM Lubomir Elko notifications@github.com
wrote: