title: Micronaut - No bean of type [io.micronaut.transaction.SynchronousTransactionManager] exists
body: <p>I'm migrating one of my Microservices from Spring to Micronaut and this is a problem I'm facing while calling a controller to load one entity. The error I get is:</p>
  <pre><code>{
      &quot;message&quot;: &quot;Internal Server Error: No bean of type [io.micronaut.transaction.SynchronousTransactionManager] 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).&quot;
  }
  </code></pre>
  <p>I already enabled the <code>io.micronaut.context.condition</code> logger, setting it to <code>TRACE</code> level, but I see no reference of the class <code>SynchronousTransactionManager</code> in the logs.</p>
  <p>This is my build.gradle:</p>
  <pre><code>buildscript {
      repositories {
          jcenter()
          mavenCentral()
          maven {
              url &quot;https://plugins.gradle.org/m2/&quot;
          }
          maven {
              url 'https://jitpack.io'
          }
      }
      dependencies {
          classpath &quot;org.hibernate:hibernate-gradle-plugin:5.4.12.Final&quot;
      }
  }
  
  plugins {
      id(&quot;com.github.johnrengelman.shadow&quot;) version &quot;6.1.0&quot;
      id(&quot;io.micronaut.application&quot;) version &quot;1.3.3&quot;
      id('com.google.protobuf') version '0.8.11'
      id('java')
      id('idea')
  }
  
  apply plugin: 'org.hibernate.orm'
  hibernate {
      enhance {
          enableLazyInitialization = true
          enableDirtyTracking = true
          enableAssociationManagement = true
      }
  }
  
  version = &quot;0.1&quot;
  group = &quot;com.elevenstars.service&quot;
  
  repositories {
      mavenCentral()
      jcenter()
  }
  
  micronaut {
      runtime(&quot;netty&quot;)
      testRuntime(&quot;junit5&quot;)
      processing {
          incremental(true)
          annotations(&quot;com.elevenstars.service.*&quot;)
      }
  }
  
  dependencies {
      // Annotation processors - Order does matter!!
      annotationProcessor(&quot;org.mapstruct:mapstruct-processor:1.4.1.Final&quot;)
      annotationProcessor(&quot;org.projectlombok:lombok&quot;)
      annotationProcessor(&quot;io.micronaut.data:micronaut-data-processor&quot;)
      annotationProcessor('io.micronaut:micronaut-inject-java')
      annotationProcessor(&quot;io.micronaut:micronaut-graal&quot;)
      annotationProcessor(&quot;io.micronaut.security:micronaut-security-annotations&quot;)
  
      // Micronaut libs
      implementation(&quot;io.micronaut:micronaut-validation&quot;)
      implementation(&quot;io.micronaut:micronaut-runtime&quot;)
      implementation(&quot;io.micronaut:micronaut-inject&quot;)
      implementation(&quot;io.micronaut.xml:micronaut-jackson-xml&quot;)
      implementation(&quot;javax.annotation:javax.annotation-api&quot;)
      compileOnly(&quot;org.graalvm.nativeimage:svm&quot;)
  
      // Kafka
      implementation(&quot;io.micronaut.kafka:micronaut-kafka&quot;)
  
      // Consul
      implementation(&quot;io.micronaut:micronaut-discovery-client&quot;)
  
      // Security
      implementation(&quot;io.micronaut.security:micronaut-security-annotations&quot;)
      implementation(&quot;io.micronaut.security:micronaut-security-jwt&quot;)
  
      // Database access
      implementation(&quot;io.micronaut.data:micronaut-data-hibernate-jpa&quot;)
      implementation(&quot;io.micronaut.beanvalidation:micronaut-hibernate-validator&quot;)
      implementation('com.vladmihalcea:hibernate-types-52:2.9.7')
      implementation &quot;org.hibernate:hibernate-graalvm:5.4.12.Final&quot;
      runtimeOnly('org.postgresql:postgresql')
  
      //Mapping
      implementation 'org.mapstruct:mapstruct:1.4.1.Final'
  
      // gRPC
      implementation 'io.grpc:grpc-protobuf:1.33.0'
      implementation 'io.grpc:grpc-stub:1.33.0'
      implementation 'io.grpc:grpc-netty:1.33.0'
      implementation 'io.grpc:grpc-core:1.33.0'
      implementation('io.grpc:grpc-netty-shaded:1.33.0') {
          version {
              strictly &quot;1.33.0&quot;
          }
          because &quot;fails to run&quot;
      }
  
      // Protobuf
      implementation 'com.google.protobuf:protobuf-java-util:3.11.4'
  
      // Dev tools
      compileOnly 'org.projectlombok:lombok'
  
      // Other stuff
      implementation(&quot;io.micronaut:micronaut-http-client&quot;)
      runtimeOnly(&quot;ch.qos.logback:logback-classic&quot;)
  }
  
  
  application {
      mainClass.set(&quot;com.elevenstars.service.facilities.Application&quot;)
  }
  
  java {
      sourceCompatibility = JavaVersion.toVersion(&quot;11&quot;)
      targetCompatibility = JavaVersion.toVersion(&quot;11&quot;)
  }
  
  task mapStruct() {
      sourceSets.main.java.srcDir file(&quot;${buildDir}/mappers&quot;)
      tasks.withType(JavaCompile) {
          options.setAnnotationProcessorGeneratedSourcesDirectory(file(&quot;${buildDir}/mappers&quot;))
          options.compilerArgs &lt;&lt; &quot;-Amapstruct.defaultComponentModel=jsr330&quot;
      }
  }
  compileJava.dependsOn(mapStruct)
  </code></pre>
  <p>This is my <code>application.yml</code></p>
  <pre><code>micronaut:
    application:
      name: facilities
    security:
      authentication: bearer
      token:
        jwt:
          signatures:
            secret:
              generator:
                secret: my-secret
          bearer:
            enabled: true
      enabled: true
      redirect:
        unauthorized:
          enabled: false
  
    server:
      context-path: /v1/facilities
      port: 8080
      cors:
        enabled: true
  kafka:
    bootstrap:
      servers: localhost:9092
    embedded:
      enabled: false
  
  jackson:
    #    time-zone: UTC
    serialization:
      write-dates-as-timestamps: false
    deserialization:
      fail-on-unknown-properties: false
    generator:
      write-numbers-as-strings: false
    time-zone: UTC
  
  consul:
    client:
      registration:
        enabled: true
      defaultZone: &quot;${CONSUL_HOST:localhost}:${CONSUL_PORT:8500}&quot;
  
  jpa:
    default:
      entity-scan:
        packages: 'com.elevenstars.service.facilities.domain.entity'
      properties:
        hibernate:
          dialect: org.hibernate.dialect.PostgreSQLDialect
          format_sql: true
          jdbc:
            time_zone: UTC
        #        ddl-auto: update
        show-sql: false
        open-in-view: false
  
  datasource:
    default:
      url: jdbc:postgresql://localhost:5432/facilities
      username: *hidden*
      password: *hidden*
  
  </code></pre>
  <p>Controller:</p>
  <pre><code>@Controller
  @Secured(SecurityRule.IS_AUTHENTICATED)
  public class GymController extends BaseController
  {
      private final GymReconstructionService gymReconstructionService;
      private final PatrimonyMapper patrimonyMapper;
  
      @Inject
      public GymController(
          GymReconstructionService gymReconstructionService,
          PatrimonyMapper patrimonyMapper
      ) {
          this.gymReconstructionService = gymReconstructionService;
          this.patrimonyMapper = patrimonyMapper;
      }
  
      @Get(&quot;/gym/upgrade/estimation&quot;)
      public HttpResponse&lt;ReconstructionEstimation&gt; getUpgradeReconstructionEstimation() {
          return HttpResponse.ok(gymReconstructionService.getUpgradeEstimations());
      }
  }
  </code></pre>
  <p>Application Service</p>
  <pre><code>@Singleton
  @Transactional
  public class GymReconstructionService extends ApplicationService
  {
      private final GymRepository gymRepository;
      private final DebitMoneyClient debitMoneyClient;
      private final LoggedUser loggedUser;
  
      @Inject
      public GymReconstructionService(
          GymRepository gymRepository,
          DebitMoneyClient debitMoneyClient,
          LoggedUser loggedUser
      ) {
          this.loggedUser = loggedUser;
          this.gymRepository = gymRepository;
          this.debitMoneyClient = debitMoneyClient;
      }
  
      public ReconstructionEstimation getUpgradeEstimations() {
          var gym = getGym(loggedUser.getClubId());
  
          return gym.getUpgradeReconstructionEstimation();
      }
      private Gym getGym(UUID clubId) throws GymNotFoundException {
          return gymRepository
              .findById(clubId)
              .orElseThrow(GymNotFoundException::new);
      }
  }
  </code></pre>
  <p>One thing I've realized was if I remove the <code>@Transactional</code> annotation, this error doesn't happen anymore, but I end up with another error:</p>
  <pre><code>{
      &quot;message&quot;: &quot;Internal Server Error: No backing RepositoryOperations configured for repository. Check your configuration and try again&quot;
  }
  </code></pre>
  <p>Any clue here about what's going on?</p>