0

A few days earlier I had no problems with building the project. But suddenly I can't access the lib directory (SchoolManagement/SchoolManagement/dist/lib). I can't even delete the lib directory. It shows error "Access Denied!".

The output log shows:

    ant -f C:\\Users\\Dinesh\\Dropbox\\SchoolManagement\\SchoolManagement -   Dnb.internal.action.name=rebuild clean jar
    init:
    deps-clean:
    Deleting directory    C:\Users\Dinesh\Dropbox\SchoolManagement\SchoolManagement\build
    clean:
    init:
    deps-jar:
    Created dir: C:\Users\Dinesh\Dropbox\SchoolManagement\SchoolManagement\build\classes
    Created dir: C:\Users\Dinesh\Dropbox\SchoolManagement\SchoolManagement\build\empty
    Created dir: C:\Users\Dinesh\Dropbox\SchoolManagement\SchoolManagement\build\generated-sources\ap-source-output
    Compiling 14 source files to C:\Users\Dinesh\Dropbox\SchoolManagement\SchoolManagement\build\classes
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    Copying 2 files to C:\Users\Dinesh\Dropbox\SchoolManagement\SchoolManagement\build\classes
compile:
    Copying 1 file to C:\Users\Dinesh\Dropbox\SchoolManagement\SchoolManagement\build
    Copy libraries to C:\Users\Dinesh\Dropbox\SchoolManagement\SchoolManagement\dist\lib.
C:\Users\Dinesh\Dropbox\SchoolManagement\SchoolManagement\nbproject\build-impl.xml:993: The following error occurred while executing this line:
C:\Users\Dinesh\Dropbox\SchoolManagement\SchoolManagement\nbproject\build-impl.xml:837: 
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)
    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.GeneratedMethodAccessor103.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    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.GeneratedMethodAccessor103.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    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.GeneratedMethodAccessor103.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    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: 28 seconds)
Dinesh Roy
  • 141
  • 4
  • 12

1 Answers1

2

Ok firstly we may need to see the exact lines of code just incase as there is a null pointer error, however it may be due to being unable to access your directory depending upon your privileges Netbeans has to the C:/ drive.

Possible solution

If Netbeans cannot delete the directory you may want to try running netbeans as administrator to have the required privileges (right click and run as admin) and then maybe it will work. Also there seems to be a null pointer exception but this may be because of the lack of privileges

Other solution

As this is a school project, if you are running on a school computer im going to assume to some extent that they may have given you an account that doesn't have raised privileges and that may be the issue, you could try copying the file manually to a new location where your account does have privileges to read/write from.

D3181
  • 2,037
  • 5
  • 19
  • 44
  • The project runs with no errors. The error occurs while I try to build the project. @Dean219 – Dinesh Roy Oct 09 '16 at 11:19
  • Its possible that is still the privileges since its netbeans that requires the privilege to delete a folder, your program most likely does not need such access and so it would run regardless of whether it had that access or not – D3181 Oct 09 '16 at 11:22
  • I tried running Netbeans as administrator but couldn't delete the directory. @Dean219 – Dinesh Roy Oct 09 '16 at 11:31
  • It's unbelievable! I restarted my PC, Windows 10 updated, opened Netbeans and tried building once again. It showed, "Build Successful!" – Dinesh Roy Oct 09 '16 at 12:15
  • It almost consumed my whole day. – Dinesh Roy Oct 09 '16 at 12:17
  • Haha that's a shame, well as long as it works now I guess you should be happy but Yeh these kinda errors can be annoying when u r unsure if it is going to do it again since you have no idea what caused it to begin with but glad it got fixed, good luck with your project ☺ – D3181 Oct 09 '16 at 12:29