title: JPA Entity : Unable to locate persister
body: <p>I get this error</p>
  <pre><code>Caused by: java.lang.IllegalArgumentException: Unable to locate persister: model.Author
  </code></pre>
  <p>When trying to use my EntityManager inside a Spring Boot application. I have no idea whatsoever why it isnt recognizing it.</p>
  <p>The Main Class:</p>
  <pre><code>@SpringBootApplication
  @ComponentScan(basePackages = {&quot;config&quot;})
  @EntityScan(basePackages = {&quot;model&quot;})
  public class SpielwieseJpaJdbcApplication implements CommandLineRunner {
  
      public static void main(String[] args) {
          SpringApplication.run(SpielwieseJpaJdbcApplication.class, args);
      }
  
      @Override
      public void run(String... args) throws Exception {
          EntityManagerFactory emf = Persistence.createEntityManagerFactory(&quot;sks&quot;);
          EntityManager em = emf.createEntityManager();
          Author author = em.find(Author.class,1);
      }
  }
  </code></pre>
  <p>The entity itself:</p>
  <pre><code>@Data
  @NoArgsConstructor
  @AllArgsConstructor
  
  @Entity
  @Table(name = &quot;authors&quot;)
  public class Author {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
  
      @Column(nullable = false)
      private String name;
  }
  
  </code></pre>
  <p>Finally my persistence.xml file where i define the persistence unit:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;persistence xmlns=&quot;http://xmlns.jcp.org/xml/ns/persistence&quot;
               xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
               xsi:schemaLocation=&quot;http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd&quot;
               version=&quot;2.2&quot;&gt;
      &lt;persistence-unit name=&quot;sks&quot; transaction-type=&quot;RESOURCE_LOCAL&quot;&gt;
          &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
  
          &lt;properties&gt;
              &lt;property name=&quot;javax.persistence.jdbc.url&quot; value=&quot;jdbc:mysql://localhost:3306/sks?serverTimezone=Europe/Vienna&quot; /&gt;
              &lt;property name=&quot;javax.persistence.jdbc.user&quot; value=&quot;sks&quot; /&gt;
              &lt;property name=&quot;javax.persistence.jdbc.password&quot; value=&quot;technikum1&quot; /&gt;
              &lt;property name=&quot;hibernate.show_sql&quot; value=&quot;true&quot; /&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  
  </code></pre>
  <p>My project structure is straight forward</p>
  <p>main/java//
  main/java//Author.java</p>
  <p>Any ideas ?</p>
  <p>At this point im basicly desperate.</p>