title: Java error compiler with multiple persistence-units
body: <p>Netbeans 14 with java 8 or 17.</p>
  <p>With a single persistent-unit using the Users.java and UsersJpaController.java classes to access a single table Users, everything works fine.</p>
  <p>When I configure a second persistence-unit to access another database,
  I get this error (without adding code or creating tables; only add persistence-unit)</p>
  <pre class="lang-none prettyprint-override"><code>Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile
  (default-compile) on project management: 
  Fatal error compiling: java.lang.RuntimeException:
  javax.annotation.processing.FilerException:
  **Attempt to recreate a file for type it.lsc.management.db.Users_**
  -&gt; [Help 1]
  </code></pre>
  <p>I need to connect to some databases at the same time. Do you have any suggestions to solve the problem?</p>
  <p>The file persistence.xml is:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;persistence version=&quot;2.1&quot; 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_1.xsd&quot;&gt;
    &lt;persistence-unit name=&quot;db_management&quot; transaction-type=&quot;RESOURCE_LOCAL&quot;&gt;
      &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
      &lt;properties&gt;
        &lt;property name=&quot;javax.persistence.jdbc.url&quot; value=&quot;jdbc:sqlserver://192.168.0.25\SQLEXPRESS:1433;databaseName=CRM_LSC;encrypt=false&quot;/&gt;
        &lt;property name=&quot;javax.persistence.jdbc.user&quot; value=&quot;uuu&quot;/&gt;
        &lt;property name=&quot;javax.persistence.jdbc.driver&quot; value=&quot;com.microsoft.sqlserver.jdbc.SQLServerDriver&quot;/&gt;
        &lt;property name=&quot;javax.persistence.jdbc.password&quot; value=&quot;uuu!&quot;/&gt;
      &lt;/properties&gt;
    &lt;/persistence-unit&gt;
    &lt;persistence-unit name=&quot;db_agen&quot; transaction-type=&quot;RESOURCE_LOCAL&quot;&gt;
      &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
      &lt;properties&gt;
        &lt;property name=&quot;javax.persistence.jdbc.url&quot; value=&quot;jdbc:sqlserver://192.168.0.195\SQLEXPRESS:1433;databaseName=db_agen&quot;/&gt;
        &lt;property name=&quot;javax.persistence.jdbc.user&quot; value=&quot;uu&quot;/&gt;
        &lt;property name=&quot;javax.persistence.jdbc.driver&quot; value=&quot;com.microsoft.sqlserver.jdbc.SQLServerDriver&quot;/&gt;
        &lt;property name=&quot;javax.persistence.jdbc.password&quot; value=&quot;uuu!&quot;/&gt;
      &lt;/properties&gt;
    &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>