-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Hello everyone
I'm using karate-core@v1.5.0
for running integration tests for a Quarkus application. After upgrading to Quarkus version 3.16.3 I keeps receiving an exception "stacktrace added below", its mainly related to a NPE handler from QuarkusClassLoaderHandler
from io.github.classgraph. Doing some investigation I've seen that you're using maven-shade-plugin
to relocate some package to different names with Karate
prefix, so this QuarkusClassLoaderHandler
class is being added to Karate
package.
Below is the exception trace I'm receiving.
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.Collection.iterator()" because the return value of "karate.nonapi.io.github.classgraph.reflection.ReflectionUtils.getFieldVal(boolean, Object, String)" is null at karate.nonapi.io.github.classgraph.classloaderhandler.QuarkusClassLoaderHandler.findClasspathOrderForQuarkusClassloader(QuarkusClassLoaderHandler.java:120) at karate.nonapi.io.github.classgraph.classloaderhandler.QuarkusClassLoaderHandler.findClasspathOrder(QuarkusClassLoaderHandler.java:111) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ... 18 more
Runner.path("path").parallel(1);
is to reproduce the issue.
After doing some investigation I found out that this error is coming from io.github.classgraph
and being solved here classgraph/classgraph#893 which is fixing classgraph/classgraph#891 .
My suggestion is basically upgrade io.github.classgraph
dependency version for 4.1.178 at least and I believe it will fix it.
My environment is as follows.
JDK: 21
Quarkus: 3.16.3
Karate: 1.5.0