Skip to content

Help wanted: compiling mockito with native-image #2435

Open
@eiswind

Description

@eiswind

I am trying to compile mockito with mock-maker-proxy with graalvm native image, and I got stuck with the plugin mechanism (At least the stacktrace point to that). (In preparation for having some mockito suppport in spring-native spring-attic/spring-native#1063)

I know this maybe a little of topic, but having at least "some" mockito when running native tests made me get started with this.

What I've got so far is

  • some proxy config
  • some reflection config
  • basic compiler args

When I compile this example
https://github.com/eiswind/native-mock-example

I get a NPE at:

     Caused by: java.lang.NullPointerException
       org.mockito.internal.configuration.plugins.Plugins.getStackTraceCleanerProvider(Plugins.java:26)
       org.mockito.internal.exceptions.stacktrace.StackTraceFilter.<clinit>(StackTraceFilter.java:20)
       com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375)
       com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295)

from which I would guess that registry itself is null, but that makes only little sense.
I added some --initialize-at-runtime for the plugins package but that didn't do it.

So for know I can only hope that this is something of interest and I really would appreciate some pointers what to try.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions