question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using a Karate standalone error is produced when trying to use internal java class

See original GitHub issue

When executing karate standalone as a mock server error is produced when trying to load internal Java class:

Caused by: com.intuit.karate.KarateException: js failed:
>>>>
01: Java.type('example.QueueUtils')
<<<<
org.graalvm.polyglot.PolyglotException: TypeError: Access to host class example.QueueUtils is not allowed or does not exist.
- <js>.:program(Unnamed:1)

mock.feature:4

This is on latest Karate version 1.1.0. I am reporting it after trying to use the suggested solution from @ptrthomas : https://stackoverflow.com/questions/58398742/unable-to-use-readclasspath-when-running-tests-with-standalone-karate-jar/58398958#58398958 and still receiving the same error. Execution command from inside ‘example’ folder: java -cp karate.jar:. com.intuit.karate.Main "$@" -m mock.feature

I am adding reproducible example for the behavior (the Karate jar file is not include so the size of the archive can stay low). example.zip

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ptrthomascommented, Aug 5, 2021

@ChavdarEmilovPagoNxt it gets complicated when you mix java, that’s all. many teams are using karate mocks without maven because normally you need only one or two text files. I suggest work with someone who knows Java and Maven well. it is possible to even start karate mocks on a common server for everyone to use, but figuring out how to do that is up to you. maybe Docker is something else you should consider.

0reactions
ChavdarEmilovPagoNxtcommented, Aug 10, 2021

@ptrthomas thank you! I maybe check it in the future but it is not necessary for the project at this time and there are other priorities…

Read more comments on GitHub >

github_iconTop Results From Across the Web

problems when loading custom compiled JAVA class ... - GitHub
Hi, I am working on the server side karate, and I have problems when dealing with the java class. With in the "karate/karate-demo/src/test/java/ ......
Read more >
karate framework graphql error on standalone [duplicate]
I have a simple graphql which works well in the maven build but getting error when executed as a feature file with the...
Read more >
Karate | Test Automation Made Simple.
And you don't need to create additional Java classes for any of the payloads that you need to work with. Index. Start, Maven...
Read more >
Eclipse IDE: Create and Run Your First Java Project
This Step By Step Tutorial Explains How to Create a New Java Project and Run It as a Java Application in the Eclipse...
Read more >
Tutorial: Debug your first Java application | IntelliJ IDEA ...
You have created and run your Java application. Let's imagine you have discovered that it functions not the way you expected.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found