My code has no errors. If I choose F6 (Run) it executes fine. If I Clean it, there are no errors. But if I clean and build, I get these errors because of bug(s) in Netbeans 8.0.2 and/or Ant 1.9.4. The completely unacceptable workaround is to create a new project and copy all the files into it. This works for awhile. Then I have to do it again.
EDIT
I use tika-app-1.9.jar
as library file. It is 45MB. If I remove it and instead use tika-parsers-1.10.jar
and tika-core-1.10.jar
as library files, I don't get this error BUT my program then can't properly process .PDF
files. And with the huge library, the program has compiled successfully dozens of times and run as standalone (i.e., outside Netbeans) many more times.
END OF EDIT
EDIT 2
OK. I deleted replaced the two smaller library files with tika-app-1.10.jar
and clean and build WORKED.
ONCE.
END EDIT
Please offer some insight into why it's happening and how to fix and prevent it or otherwise debug it. I have over 3000 lines of debug output but the bottom line, whether debug is selected or not is always these:
C:\Users\Dov\Google Drive\NetBeansProjects\Find\nbproject\build-impl.xml:994: The following error occurred while executing this line:
C:\Users\Dov\Google Drive\NetBeansProjects\Find\nbproject\build-impl.xml:838:
java.lang.NullPointerException
at org.apache.tools.ant.util.ResourceUtils.copyResource(ResourceUtils.java:439)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:559)
Here's my project:
I haven't messed with build.xml
or any other generated files.
I've restarted Netbeans 8.0.2 and looked for instances of JVM that might be running. There aren't.
Here's the Ant screen:
Here's more of the stack trace:
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:519)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:480)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:443)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:409)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:384)
at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:322)
at org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs.execute(CopyLibs.java:206)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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:292)
at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
BUILD FAILED (total time: 4 seconds)
Please note these lines that FOLLOW the BUILD FAILED line:
Could not load class (org.apache.tools.ant.taskdefs.repository.MavenRepository) for type mavenrepository
Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
Could not load a dependent class (javax/media/jai/PlanarImage) for type image
Could not load class (org.apache.tools.ant.taskdefs.repository.MavenRepository) for type mavenrepository
Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
Could not load a dependent class (javax/media/jai/PlanarImage) for type image