0

When trying to execute script either with Junit 4 or 5 getting this error. Pasting sample feature file and runner file and error details. I did check the version for java and it is as required. following is Java version "1.8.0_271"

Feature file:
Feature: fetching User Details
 Scenario: testing the get call for User Details
 Given url 'https://reqres.in/api/users/2'
When method GET
Then status 200
* print 'Test'

Getting follwing exception:

java.lang.ExceptionInInitializerError
    at com.intuit.karate.junit4.Karate.<init>(Karate.java:81)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
    at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
    at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:90)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:76)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:49)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:526)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
Caused by: java.lang.NullPointerException: Cannot invoke "javax.script.ScriptEngine.createBindings()" because "com.intuit.karate.ScriptBindings.NASHORN" is null
    at com.intuit.karate.ScriptBindings.createBindings(ScriptBindings.java:160)
    at com.intuit.karate.core.Tags.<init>(Tags.java:158)
    at com.intuit.karate.core.Tags.<clinit>(Tags.java:48)
    ... 19 more
Huma
  • 71
  • 1
  • 2
  • 11
  • works for me. please follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue – Peter Thomas Jan 31 '21 at 05:41
  • 1
    i think more people are here on stackoverflow. and when they post problem here.. it does not in any way mean KArate or any other software has problem.. Its that they did something wrong and we can guide them what to be fixed ... as the same problem is facfe by multilple people and stackoverflow is a good platform to see all those answers.. – Gaurav Khurana Feb 19 '21 at 08:32

0 Answers0