1

I am using selenium with testng and maven.Caused by: java.lang.RuntimeException: java.lang.reflect.InaccessibleObjectException: Unable to make native jdk.internal.reflect.ConstantPool java.lang.Class.getConstantPool() accessible: module java.base does not "opens java.lang" to unnamed module @4387b79e.at Runner.TestRunner.feature(TestRunner.java:47). If anymore details required please ping me. I am not able to start the project. Earlier it gave the exception class not found for which I added,

Unable to make native jdk.internal.reflect.ConstantPool java.lang.Class.getConstantPool() accessible: module java.base does not "opens java.lang" to unnamed module @4387b79e

    <dependency>
        <groupId>xerces</groupId>
        <artifactId>xerces</artifactId>
        <version>2.4.0</version>
    </dependency>
    <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.11.0</version>
    </dependency>
Venkata
  • 21
  • 1
  • 4
  • 1
    possible duplicate of https://stackoverflow.com/questions/41265266/how-to-solve-inaccessibleobjectexception-unable-to-make-member-accessible-m – cruisepandey Jul 12 '21 at 10:04
  • Please look into this. It is not allowing me to establish the environment in eclipse. – Venkata Jul 12 '21 at 10:13

2 Answers2

1
Now it is giving the folloing error

[ERROR] Tests run: 2, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 62.064 s <<< FAILURE! - in TestSuite
[ERROR] feature(Runner.TestRunner)  Time elapsed: 52.413 s  <<< FAILURE!
java.lang.ExceptionInInitializerError
    at Runner.TestRunner.feature(TestRunner.java:47)
Caused by: java.lang.RuntimeException: java.lang.reflect.InaccessibleObjectException: Unable to make native jdk.internal.reflect.ConstantPool java.lang.Class.getConstantPool() accessible: module java.base does not "opens java.lang" to unnamed module @4387b79e
    at Runner.TestRunner.feature(TestRunner.java:47)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make native jdk.internal.reflect.ConstantPool java.lang.Class.getConstantPool() accessible: module **java.base does not "opens java.lang" to unnamed module @4387b79e
    at Runner.TestRunner.feature(TestRunner.java:47)**

[ERROR] tearDownClass(Runner.TestRunner)  Time elapsed: 52.536 s  <<< FAILURE!
java.lang.NullPointerException: Cannot invoke "com.aventstack.extentreports.ExtentTest.assignAuthor(String[])" because the return value of "com.cucumber.listener.Reporter.getCurrentScenario()" is null
    at Runner.TestRunner.tearDownClass(TestRunner.java:58)

************************************************************************

If I try the below dependency instead of xereces dependency as below
    <dependency> 
      <groupId>xml-apis</groupId>
      <artifactId>xml-apis</artifactId>
      <version>1.4.01</version>
    </dependency>

I am getting the following error


[ERROR] tearDownClass(Runner.TestRunner)  Time elapsed: 19.433 s  <<< FAILURE!
**java.lang.NoClassDefFoundError: org/w3c/dom/ls/DocumentLS**
    at Runner.TestRunner.tearDownClass(TestRunner.java:57)
Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ls.DocumentLS
    at Runner.TestRunner.tearDownClass(TestRunner.java:57)
Venkata
  • 21
  • 1
  • 4
0

Anymore information required, please let me know. thanks.

Venkata
  • 21
  • 1
  • 4