title: Failed to load a service: io.micronaut.context.exceptions.BeanContextException: | Micronaut
body: <p>I have just created a file named <code>TransactionsRepository.java</code>. I am not calling this class anywhere as of now</p>
  <p><strong>TransactionsRepository.java</strong></p>
  <pre class="lang-java prettyprint-override"><code>package com.example.Transactions;
  
  import io.micronaut.data.annotation.Repository;
  
  // @Repository
  public interface TransactionsRepository {
  }
  </code></pre>
  <p>Whenever I run ./gradlew run, it runs perfectly, but the moment I uncomment this line, it throws an error</p>
  <pre><code>@Repository
  </code></pre>
  <p><strong>ERROR</strong></p>
  <blockquote>
  <p>Exception in thread &quot;main&quot; java.lang.RuntimeException: Failed to load a service: io.micronaut.context.exceptions.BeanContextException: Unexpected error loading be
  an definition [com.example.$Transactions.TransactionsRepository$Intercepted$Definition]: failed to access class com.example.Transactions.TransactionsRepository$In
  tercepted from class com.example.$Transactions.TransactionsRepository$Intercepted$Definition$Reference (com.example.Transactions.TransactionsRepository$Intercepte
  d and com.example.$Transactions.TransactionsRepository$Intercepted$Definition$Reference are in unnamed module of loader 'app')</p>
  </blockquote>
  <p>I even tried doing this but still does not work</p>
  <pre class="lang-java prettyprint-override"><code>@Repository
  public interface TransactionsRepository extends  CrudRepository&lt;Transaction, Long&gt;{
  }
  </code></pre>
  <p>I have also included below line in my gradle file</p>
  <p><code>annotationProcessor(&quot;io.micronaut.data:micronaut-data-hibernate-jpa&quot;)</code></p>
  <hr />
  <p>I am very new to micronaut. Its been hours I am trying this. I dont know whats wrong in this code. Please help me if I am missing something.</p>