title: JPA: Error: Attempt to recreate a file for type <MyClass>
body: <p>Every time I run my code, I get the following error:</p>
  
  <pre><code> java.lang.RuntimeException: javax.annotation.processing.FilerException: Attempt to recreate a file for type domein.ClubLes_
      [javac]     at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:407)
      [javac]     at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:964)
      [javac]     at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:881)
      [javac]     at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100(JavacProcessingEnvironment.java:110)
      [javac]     at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1202)
      [javac]     at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1311)
      [javac]     at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1250)
      [javac]     at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:928)
      [javac]     at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:306)
      [javac]     at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:165)
      [javac]     at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
      [javac]     at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
      [javac] Caused by: javax.annotation.processing.FilerException: Attempt to recreate a file for type domein.ClubLes_
      [javac]     at jdk.compiler/com.sun.tools.javac.processing.JavacFiler.checkNameAndExistence(JavacFiler.java:727)
      [javac]     at jdk.compiler/com.sun.tools.javac.processing.JavacFiler.createSourceOrClassFile(JavacFiler.java:489)
      [javac]     at jdk.compiler/com.sun.tools.javac.processing.JavacFiler.createSourceFile(JavacFiler.java:426)
      [javac]     at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.generateCanonicalModelClass(CanonicalModelProcessor.java:98)
      [javac]     at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.generateCanonicalModelClasses(CanonicalModelProcessor.java:226)
      [javac]     at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:403)
      [javac]     ... 11 more
  
  BUILD FAILED
  E:\ProjectJava\java-g11\Taijitan\nbproject\build-impl.xml:1134: The following error occurred while executing this line:
  E:\ProjectJava\java-g11\Taijitan\nbproject\build-impl.xml:381: Compile failed; see the compiler error output for details.
  </code></pre>
  
  <p>At first I thought it was because I accidently forgot to add the subclass, but it's still giving me the same error. ClubLes inherits from Les, which is an interface which contains only getters. Do I need to make the interface serializable aswell? I have no idea what's going wrong.</p>
  
  <p><strong>ClubLes</strong></p>
  
  <pre><code>@Entity
  public class ClubLes implements Serializable, Les {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "LesId")
      private int id;
      @Column(name = "Naam")
      String naam;
      @Column(name = "Soort")
      String soort;
      @ManyToOne
      @JoinColumn(name = "GraadNumeriek")
      Graad graad;
      @Column(name = "FotoUrl")
      private String fotoUrl;
      @Column(name = "Beschrijving")
      private String beschrijving;
      @Column(name = "VideoUrl")
      private String videoUrl;
  
      public ClubLes() {
      }
  </code></pre>
  
  <p><strong>Les interface</strong></p>
  
  <pre><code>public interface Les {
  
      int getId();
      String getNaam();
      String getSoort();
      //More getters
  }
  </code></pre>
  
  <p><strong>PU</strong><br>
  I only have one persistence unit, which looks like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"&gt;
    &lt;persistence-unit name="TaijitanPU" transaction-type="RESOURCE_LOCAL"&gt;
      &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
      &lt;class&gt;domein.Graad&lt;/class&gt;
      &lt;class&gt;domein.Locatie&lt;/class&gt;
      &lt;class&gt;domein.ClubPersoon&lt;/class&gt;
      &lt;class&gt;domein.ClubActiviteit&lt;/class&gt;
      &lt;class&gt;domein.ClubLes&lt;/class&gt;
      &lt;properties&gt;
        &lt;property name="javax.persistence.jdbc.url" value="jdbc:sqlserver://localhost:1433;databaseName=Taijitan"/&gt;
        &lt;property name="javax.persistence.jdbc.user" value="sa"/&gt;
        &lt;property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/&gt;
        &lt;property name="javax.persistence.jdbc.password" value="Wachtwoord2019"/&gt;
        &lt;property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/&gt;
      &lt;/properties&gt;
    &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>I also noticed that when I remove clublesson from JPA, it throws the same error for ClubPersoon, which follows the same scheme</p>