Spring Boot Native 3.0.1 fails to start when using spring data jpa, h2 and spring web. It gives the error below:

IllegalStateException: No available JtaPlatform candidates when running the spring boot native image using

I created here a sample project and the steps to reproduce the problem. Please note that running the application as an executable jar or docker image works fine. I assume it should work by default with spring native too.

Comment From: scottfrederick

@mihaita-tinta Thanks for trying the Spring Boot 3 native support. The issue with your sample is that you are missing some build configuration. As shown in the documentation, you need the Native Build Tools plugin in your pom.xml:

  <build>
    <plugins>

      ...

      <plugin>
        <groupId>org.graalvm.buildtools</groupId>
        <artifactId>native-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

Your sample works for me after adding this plugin.

If you compare your pom.xml to one generated by start.spring.io, you'll see that there is also some suggested Hibernate configuration.

Can you try adding the NBT plugin to your build and see if it fixes your problem?

Comment From: mihaita-tinta

After adding the plugin, I can also run the native image.