2

I am getting following exception when trying to call feature file of another module from different module with logs as, org.graalvm.polyglot.PolyglotException: TypeError: Access to host class utils.Utils is not allowed or does not exist.

Following is the file which I am trying to run as, https://github.com/bipin-k/karate-automation/blob/master/sample-automation/src/main/java/sample.feature

https://github.com/bipin-k/karate-automation

karate error description

  • 2
    sorry, your project is too complicated for me to understand so I'm giving up. if you can, follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue – Peter Thomas Sep 09 '21 at 13:37

1 Answers1

2

Please read this answer for hints on how to handle re-use across Java modules: https://stackoverflow.com/a/58339662/143475

Recommendation is to avoid it as far as possible. And things like call read('../../../../core-utilities/src/main/java/java-functions-calls.feature') lead to un-maintainable tests: https://stackoverflow.com/a/54126724/143475

Most likely the problem is because in the project where you make the call - the utils.Utils class is simply not on the Java "classpath". You should probably take the help of someone who knows Java well, or stick to a simpler "single module" Java project.

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248