title: Micronaut data native-image: No bean of type [io.micronaut.data.operations.PrimaryRepositoryOperations] exists
body: <p>I'm working on a new example by using Micronaut, Micronaut Data, JPA, Postgres, and GraalVM, following
  <a href="https://github.com/rmondejar/micronaut-postgres-example" rel="nofollow noreferrer">https://github.com/rmondejar/micronaut-postgres-example</a></p>
  <p>This example has been created by using Micronaut Launch, 2.0.0.RC1 with the following features:</p>
  <pre><code>[annotation-api, app-name, data, data-jpa, docker, file-watch, flyway, graalvm, gradle, hibernate-jpa, http-client, java, java-application, jdbc-hikari, logback, netty-server, postgres, readme, security-annotations, security-jwt, shade, spock, testcontainers, yaml]
  </code></pre>
  <p>Without native-image, it works perfectly, tests passed:</p>
  <pre><code>./gradlew test
  (...)
  24 passing (35.2s)
  BUILD SUCCESSFUL in 43s
  4 actionable tasks: 4 executed
  </code></pre>
  <p>Generating the native-image and executing it looks good:</p>
  <pre><code>$ ./gradlew assemble
  $ native-image --no-server -cp build/libs/mn-data-pg-*-all.jar
  $ ./mn-data-pg
  
  21:51:37.256 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
  21:51:37.286 [main] INFO  com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.
  21:51:37.287 [main] INFO  i.m.flyway.AbstractFlywayMigration - Running migrations for database with qualifier [default]
  21:51:37.287 [main] INFO  o.f.c.i.license.VersionPrinter - Flyway Community Edition 6.4.3 by Redgate
  21:51:37.290 [main] INFO  o.f.c.i.database.DatabaseFactory - Database: jdbc:postgresql://localhost:5432/postgres (PostgreSQL 12.3)
  21:51:37.318 [main] INFO  o.f.core.internal.command.DbValidate - Successfully validated 2 migrations (execution time 00:00.011s)
  21:51:37.328 [main] INFO  o.f.core.internal.command.DbMigrate - Current version of schema &quot;public&quot;: 1.1
  21:51:37.330 [main] INFO  o.f.core.internal.command.DbMigrate - Schema &quot;public&quot; is up to date. No migration necessary.
  21:51:37.349 [main] INFO  io.micronaut.runtime.Micronaut - Startup completed in 128ms. Server Running: http://localhost:8080
  </code></pre>
  <p>However, once a repository is reached, it always fails:</p>
  <pre><code>$ curl -d '{&quot;username&quot;:&quot;user1&quot;, &quot;password&quot;:&quot;password1&quot;}' -H &quot;Content-Type: application/json&quot; -H &quot;Authorization: Basic dXNlcjE6cGFzc3dvcmQx&quot; -X POST http://127.0.0.1:8080/login
  
  Unexpected error occurred: No backing RepositoryOperations configured for repository. Check your configuration and try again
  io.micronaut.context.exceptions.ConfigurationException: No backing RepositoryOperations configured for repository. Check your configuration and try again
      at io.micronaut.data.intercept.DataIntroductionAdvice.findInterceptor(DataIntroductionAdvice.java:124)
      at io.micronaut.data.intercept.DataIntroductionAdvice.intercept(DataIntroductionAdvice.java:78)
      at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:69)
      at io.micronaut.validation.ValidatingInterceptor.intercept(ValidatingInterceptor.java:106)
      at io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:69)
      at mn.data.pg.repositories.UserRepository$Intercepted.findByUsername(Unknown Source)
  
  Caused by: io.micronaut.context.exceptions.NoSuchBeanException: No bean of type [io.micronaut.data.operations.PrimaryRepositoryOperations] exists. Make sure the bean is not disabled by bean requirements (enable trace logging for 'io.micronaut.context.condition' to check) and if the bean is enabled then ensure the class is declared a bean and annotation processing is enabled (for Java and Kotlin the 'micronaut-inject-java' dependency should be configured as an annotation processor).
  </code></pre>
  <p>It seems a problem of misconfiguration when going to native, but since I'm following the guide and using the generated application, not sure what is missing.</p>