Describe the enhancement requested
I'm aware that graalvm is probably not supported, but I'm raising this as it might be simple fix.
There is a issue with env->FindClass in arrow-c when used with graalvm 25 (native image creates a shared library) Even all required classes are exposed for JNI in graalvm configuration env->FindClass wont be able to find a classes at
|
jclass local_class = env->FindClass(class_name); |
The issues are at:
|
kObjectClass = CreateGlobalClassReference(env, "Ljava/lang/Object;"); |
|
kRuntimeExceptionClass = |
|
CreateGlobalClassReference(env, "Ljava/lang/RuntimeException;"); |
|
kPrivateDataClass = |
|
CreateGlobalClassReference(env, "Lorg/apache/arrow/c/jni/PrivateData;"); |
|
kCDataExceptionClass = |
|
CreateGlobalClassReference(env, "Lorg/apache/arrow/c/jni/CDataJniException;"); |
|
kStreamPrivateDataClass = CreateGlobalClassReference( |
|
env, "Lorg/apache/arrow/c/ArrayStreamExporter$ExportedArrayStreamPrivateData;"); |
where class names have L and ; at the start and end of the class name, so changing class names from Ljava/lang/Object; to java/lang/Object (and all other classes) will make problem go away.
kObjectClass = CreateGlobalClassReference(env, "java/lang/Object");
kRuntimeExceptionClass =
CreateGlobalClassReference(env, "java/lang/RuntimeException");
kPrivateDataClass =
CreateGlobalClassReference(env, "org/apache/arrow/c/jni/PrivateData");
kCDataExceptionClass =
CreateGlobalClassReference(env, "org/apache/arrow/c/jni/CDataJniException");
kStreamPrivateDataClass = CreateGlobalClassReference(
env, "org/apache/arrow/c/ArrayStreamExporter$ExportedArrayStreamPrivateData");
looking at the spec,
it says correct format is without L and ';' for non array classes.
I did manage to fix this in 18.1 which could be built locally, unfortunately I can't make 18.3 run locally as instructions at https://arrow.apache.org/docs/developers/java/building.html are outdated with change to new repo
also, one small request, can
|
if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION) != JNI_OK) { |
|
return JNI_ERR; |
return error returned by vm->GetEnv rather than JNI_ERR
Describe the enhancement requested
I'm aware that graalvm is probably not supported, but I'm raising this as it might be simple fix.
There is a issue with
env->FindClassin arrow-c when used with graalvm 25 (native image creates a shared library) Even all required classes are exposed for JNI in graalvm configurationenv->FindClasswont be able to find a classes atarrow-java/c/src/main/cpp/jni_wrapper.cc
Line 60 in 34060eb
The issues are at:
arrow-java/c/src/main/cpp/jni_wrapper.cc
Lines 334 to 342 in 34060eb
where class names have
Land;at the start and end of the class name, so changing class names fromLjava/lang/Object;tojava/lang/Object(and all other classes) will make problem go away.looking at the spec,
it says correct format is without
Land ';' for non array classes.I did manage to fix this in
18.1which could be built locally, unfortunately I can't make18.3run locally as instructions at https://arrow.apache.org/docs/developers/java/building.html are outdated with change to new repoalso, one small request, can
arrow-java/c/src/main/cpp/jni_wrapper.cc
Lines 330 to 331 in 34060eb
return error returned by
vm->GetEnvrather thanJNI_ERR