Elide GraalVM25.6.0-elide.4
All types
Versions and modules

MissingJNIRegistrationError

Javaexceptionin org.graalvm.nativeimagesince 24.1

public final class MissingJNIRegistrationError extends LinkageError
Inheritance
  1. Object
  2. Throwable
  3. Error
  4. LinkageError
  5. MissingJNIRegistrationError

This exception is thrown when a JNI query tries to access an element that was not registered for JNI access in the program. When an element is not registered, the exception will be thrown both for elements that exist and elements that do not exist on the given classpath.

The purpose of this exception is to easily discover unregistered elements and to assure that all JNI operations for registered elements have the expected behaviour.

Queries will succeed (or throw the expected error) if the element was registered for JNI access. If that is not the case, a MissingJNIRegistrationError will be thrown.

The exception thrown by the JNI query is a pending exception that needs to be explicitly checked by the calling native code. Examples:

Registration: "fields": [{"name": "registeredField"}, {"name": "registeredNonexistentField"}]
GetFieldID(declaringClass, "registeredField") will return the expected field.
GetFieldID(declaringClass, "registeredNonexistentField") will throw a NoSuchFieldError.
GetFieldID(declaringClass, "unregisteredField") will throw a MissingJNIRegistrationError.
GetFieldID(declaringClass, "unregisteredNonexistentField") will throw a MissingJNIRegistrationError.

Constructors1

MissingJNIRegistrationError(String, Class<?>, Class<?>, String, String)No description.

MissingJNIRegistrationError

since 24.1
public MissingJNIRegistrationError(
    String message,
    Class<?> elementType,
    Class<?> declaringClass,
    String elementName,
    String signature
)

No description.

Parameters

messageString
No description.
elementTypeClass<?>
No description.
declaringClassClass<?>
No description.
elementNameString
No description.
signatureString
No description.

Methods4

Class<?> getElementType()No description.

getElementType

since 23.0
public Class<?> getElementType()

No description.

Returns

Class<?>
The type of the element trying to be queried (Class, Method, Field or Constructor).
Class<?> getDeclaringClass()No description.

getDeclaringClass

since 23.0
public Class<?> getDeclaringClass()

No description.

Returns

Class<?>
The class on which the missing query was tried, or null on static queries.
String getElementName()No description.

getElementName

since 23.0
public String getElementName()

No description.

Returns

String
The name of the queried element.
String getSignature()No description.

getSignature

since 23.0
public String getSignature()

No description.

Returns

String
The signature passed to the query, or null if the query doesn't take a signature as argument.

Inherited members