This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 105260 [details] Testcase in zip file Please refer to the attached testcase. Right click on project node, select Clean and Build An annotation processor threw an uncaught exception. Consult the following stack trace for details. java.lang.RuntimeException: javax.annotation.processing.FilerException: Attempt to recreate a file for type entities.TestEntity_ at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:407) at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:625) at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:554) at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:699) at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:981) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727) at com.sun.tools.javac.main.Main.compile(Main.java:353) at com.sun.tools.javac.main.Main.compile(Main.java:279) at com.sun.tools.javac.main.Main.compile(Main.java:270) at com.sun.tools.javac.Main.compile(Main.java:69) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56) at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1134) at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:912) at org.netbeans.modules.java.source.ant.JavacTask.execute(JavacTask.java:136) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor141.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor141.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor141.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) at org.apache.tools.ant.Project.executeTarget(Project.java:1368) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284) at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539) at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154) Caused by: javax.annotation.processing.FilerException: Attempt to recreate a file for type entities.TestEntity_ at com.sun.tools.javac.processing.JavacFiler.checkNameAndExistence(JavacFiler.java:478) at com.sun.tools.javac.processing.JavacFiler.createSourceOrClassFile(JavacFiler.java:372) at com.sun.tools.javac.processing.JavacFiler.createSourceFile(JavacFiler.java:363) at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.generateCanonicalModelClass(CanonicalModelProcessor.java:98) at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.generateCanonicalModelClasses(CanonicalModelProcessor.java:226) at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:403) ... 46 more
it's not an issue in my opinion, it's the way ap works in case if several pu point to same set of entities. see issues https://bugs.eclipse.org/bugs/show_bug.cgi?id=308713 and some in 183779 there was a question to enhance persistence.xml generation and generate subpackage by default but it's more like enhancment.
either nb can add -Aeclipselink.persistenceunits=VMPU bu default but i don't like it as it looks even better if compilation fail and user select appropritae pu by project properties update
according to comment above -> enhancment. there are two more alternatives to usage of subfolders or specification of specific pu for generation, also it's possiblt to specify <classes> to liit scope of pus and if you don't need and don't use metamodel it's possible to swith off metamodel generation in options/and or by removal of metamodel jar.
The most difficult subject here is user awareness. Most likely the users who encounter this issue do not intend to use the Criteria API which needs the Metamodel generation. The Criteria API is unpopular because it is verbose and difficult to learn. So perhaps the first step could be to advise the user of the option to remove the metamodel jar file which btw will speed up the build process?
yes, hint approach may be the best here, some project level warning 'you have multiple pu and no subpackages are specified, please either disable ap or add subpackages to your pus'
Looking the online site here https://jumblesolver.online and seen the amazing jumble solver multiple words game.