I am getting this warning in Eclipse. Any idea how to resolve this?
[main] WARN cucumber.runtime.SerenityBackend - It looks like you are running a feature using #RunWith(Cucumber.class) instead of #RunWith(CucumberWithSerenity.class). Are you sure this is what you meant to do?
And also the below issue while trying to open Google page through Serenity-Cucmber:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/C:/Users/304090/.m2/repository/com/google/inject/guice/4.2.0/guice-4.2.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$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
Given Open the google home page # StepDefinitions.the_launch_link()
java.lang.NullPointerException
at org.apache.commons.lang3.SystemUtils.isJavaVersionAtLeast(SystemUtils.java:1654)
at org.apache.commons.lang3.ClassUtils.isAssignable(ClassUtils.java:760)
at net.thucydides.core.steps.StepFactory$ParameterAssignementChecker.cannotBeAssignedTo(StepFactory.java:332)
at net.thucydides.core.steps.StepFactory.parametersMatchFor(StepFactory.java:242)
at net.thucydides.core.steps.StepFactory.argumentTypesFrom(StepFactory.java:218)
at net.thucydides.core.steps.StepFactory.immutableStepLibrary(StepFactory.java:212)
at net.thucydides.core.steps.StepFactory.createProxyStepLibrary(StepFactory.java:203)
at net.thucydides.core.steps.StepFactory.instantiateUniqueStepLibraryFor(StepFactory.java:179)
at net.thucydides.core.steps.StepFactory.getUniqueStepLibraryFor(StepFactory.java:115)
at net.serenitybdd.screenplay.Tasks.instrumented(Tasks.java:12)
at net.serenitybdd.screenplay.actions.Open.url(Open.java:19)
at step_defenitions.StepDefinitions.the_launch_link(StepDefinitions.java:30)
at ✽.Open the google home page(C:/Users/304090/eclipse-workspace/evms-qa-test-automation/src/test/resources/features/CreatePreViolReport.feature:5)
This issue resolved after changing the serenity version to the latest. And also had to update my browser version too.
Related
Simply doing the JetBrains introduction, Hello World.
What does all this mean? Installation problem? So many different versions of things I've had to download.
-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3\lib\idea_rt.jar=52283:C:\Program Files\JetBrains\IntelliJ IDEA 2020.3\bin" -Dfile.encoding=windows-1252 -classpath C:\Users\Student-CHCS201\AppData\Roaming\JetBrains\IntelliJIdea2020.3\plugins\Kotlin\kotlinc\lib\kotlin-compiler.jar;C:\Users\Student-CHCS201\AppData\Roaming\JetBrains\IntelliJIdea2020.3\plugins\Kotlin\kotlinc\lib\kotlin-reflect.jar;C:\Users\Student-CHCS201\AppData\Roaming\JetBrains\IntelliJIdea2020.3\plugins\Kotlin\kotlinc\lib\kotlin-stdlib.jar;C:\Users\Student-CHCS201\AppData\Roaming\JetBrains\IntelliJIdea2020.3\plugins\Kotlin\kotlinc\lib\kotlin-script-runtime.jar org.jetbrains.kotlin.cli.jvm.K2JVMCompiler -kotlin-home C:\Users\Student-CHCS201\AppData\Roaming\JetBrains\IntelliJIdea2020.3\plugins\Kotlin\kotlinc -script C:/Users/Student-CHCS201/IdeaProjects/FirstExample/src/Main.kts
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil (file:/C:/Users/Student-CHCS201/AppData/Roaming/JetBrains/IntelliJIdea2020.3/plugins/Kotlin/kotlinc/lib/kotlin-compiler.jar) to method java.util.ResourceBundle.setParent(java.util.ResourceBundle)
WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
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
Spending 2 days trying to just start the thing so far lol
I had the same problem too. I tried different versions (1.4.32, 1.4. 31, 1.4.20) of kotlin compiler, they all had the same problem on windows. On Ubuntu they work perfectly. Anyway, I install version 1.4.10 on windows, and the problem got solved.
I've a Kotlin project which uses Guice for DI and has recently been updated from JDK 8 -> 11. It now emits the following error at runtime:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/Users/matt/.gradle/caches/modules-2/files-2.1/com.google.inject/guice/4.2.2/6dacbe18e5eaa7f6c9c36db33b42e7985e94ce77/guice-4.2.2.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$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
How should this warning be addressed?
The issue is due to how Guice internally accesses Java objects, which is unsafe under the new (Java 9+) Java Module System.
Also, starting with Java 16, this warning becomes an error, and the execution flag --illegal-access=permit must be specified manually to reproduce the behaviour of Java 9-15.
There is not much you can do to fix it; the best option is to upgrade to Guice 5.0.1, which has been patched to avoid illegal accesses. Your warning will disappear, and your application will work on Java 16+ with the default JVM behaviour.
As mentioned, it's better you just upgrade to Guice 5 where this is updated.
BUT ... just in case you are stuck with Guice 4 until you can make the upgrade, just start java with these extra parameters:
java --illegal-access=permit --add-opens java.base/java.lang=ALL-UNNAMED ...
and you are good to go !!
This is all I have in my code. It's just the typical way of using Ignite:
Ignite ignite = Ignition.ignite();
The error message I saw is:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.ignite.internal.util.GridUnsafe$2 (file:/C:/Users/.../.m2/repository/org/apache/ignite/ignite-core/2.7.0/ignite-core-2.7.0.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of org.apache.ignite.internal.util.GridUnsafe$2
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
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.ignite.internal.util.IgniteUtils.<clinit>(IgniteUtils.java:795)
at org.apache.ignite.internal.IgnitionEx.<clinit>(IgnitionEx.java:209)
at org.apache.ignite.Ignition.ignite(Ignition.java:489)
at distributedjobexecutor.App.<init>(App.java:19)
at distributedjobexecutor.App.main(App.java:39)
Caused by: java.lang.RuntimeException: jdk.internal.misc.JavaNioAccess class is unavailable.
at org.apache.ignite.internal.util.GridUnsafe.javaNioAccessObject(GridUnsafe.java:1453)
at org.apache.ignite.internal.util.GridUnsafe.<clinit>(GridUnsafe.java:112)
... 5 more
Caused by: java.lang.IllegalAccessException: class org.apache.ignite.internal.util.GridUnsafe cannot access class jdk.internal.misc.SharedSecrets (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module #2ac273d3
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:360)
at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:589)
at java.base/java.lang.reflect.Method.invoke(Method.java:556)
at org.apache.ignite.internal.util.GridUnsafe.javaNioAccessObject(GridUnsafe.java:1450)
... 6 more
Why am I getting this message, and how can I fix this? I am using Java jdk-10.0.1.
This problem comes from the module access control system, introduced in Java 9.
To workaround it, use the following JVM parameters:
--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED
Add the following arguments to the VM of module
Refer this Running-apache-ignite-on-openjdk-15,-16-and-17
--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
--add-opens=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED
--add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED
--add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED
--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.base/java.nio=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
This answer is intended as an addendum to Denis' excellent answer.
In short, when you see this warning for any Java software (not just Apache Ignite):
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.ignite.internal.util.GridUnsafe$2 (file:/C:/Users/.../.m2/repository/org/apache/ignite/ignite-core/2.7.0/ignite-core-2.7.0.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of org.apache.ignite.internal.util.GridUnsafe$2
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
Add JVM arg: --illegal-access=warn
Restart the JVM and watch for illegal access warnings.
For each specific warning about a class, e.g., java.nio.Buffer, find the Java module, e.g., java.base, then add a JVM arg for the module & package: --add-opens=java.base/java.nio=ALL-UNNAMED
Rinse and repeat and until all warnings are removed.
Optionally, remove JVM arg --illegal-access=warn
For Java libraries that make extensive use of "unsafe" Java code (off-heap tricks), you might need to add more than 10 of these JVM args!
Working with RStudio v1.1.456 on an iMac with macOS Mojave (v10.14) and encountered this error:
Loading required package: XLConnect
Loading required package: XLConnectJars
XLConnect 0.2-15 by Mirai Solutions GmbH [aut],
Martin Studer [cre],
The Apache Software Foundation [ctb, cph] (Apache POI),
Graph Builder [ctb, cph] (Curvesapi Java library)
http://www.mirai-solutions.com
https://github.com/miraisolutions/xlconnect
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.poi.openxml4j.util.ZipSecureFile$1 (file:/Users/User/Library/R/3.5/library/XLConnect/java/poi-ooxml-3.17.jar) to field java.io.FilterInputStream.in
WARNING: Please consider reporting this to the maintainers of org.apache.poi.openxml4j.util.ZipSecureFile$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
Because the message includes the request to "Please consider reporting this...", I attempted to do so—however, I've never filed a bug report with Apache, and an unclear as to how to make such a post.
Suggestions?
BIG THANKS!
I am working on my automation project where I have implemented gradle with java 10 with selenium with cucumber in IntelliJ.
But when I run my project I get the below warning which I unable to resolve it.
Any help would really be appreciated.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by cucumber.deps.com.thoughtworks.xstream.core.util.Fields (file:/C:/Users/sobhit.s/.gradle/caches/modules-2/files-2.1/info.cukes/cucumber-jvm-deps/1.0.5/69ed0efe4b81f05da3c0bdc7281cbdc43f5ceb26/cucumber-jvm-deps-1.0.5.jar) to field java.util.TreeMap.comparator
WARNING: Please consider reporting this to the maintainers of cucumber.deps.com.thoughtworks.xstream.core.util.Fields
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