aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Access denied Error in the Ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Access denied Error in the Ant" Watch "Access denied Error in the Ant" New topic
Author

Access denied Error in the Ant

karthikeyan suresh
Greenhorn

Joined: May 15, 2013
Posts: 13
While building using maven or ant for the huge application,

the below error occur. Please advise to resolve the error:

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to write files: C:\Users\m1018785\.jenkins\workspace\PATH\TO\LOCAL\JAVA\FILE.java (Access is denied)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch

Thanks in advance
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

(Access is denied)


This is just a write-permission related issue. See if you have the required permission to write in the specified file.


Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
karthikeyan suresh
Greenhorn

Joined: May 15, 2013
Posts: 13
Hi,

I think it is not a write access error. I am able to proceed with the build if i try twice or thrice...But it is giving this error frequently and waste lot of time.

Regards,
Karthik
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

I am able to proceed with the build if i try twice or thrice


If you are able to do that after re-attempts then it might be a file locking issue. Is it possible that the file may be open for writing by another thread ? Could it be a synchronization issue ? Also how are you writing to the file ?
karthikeyan suresh
Greenhorn

Joined: May 15, 2013
Posts: 13
Hi Saif,

Just while building using mvn clean install command, frequently that error occurs and wasting lot of time...Once that error occurs, if we reattempt, the build is getting through.

Any permanent solution?
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

karthikeyan suresh wrote:Hi Saif,

Just while building using mvn clean install command, frequently that error occurs and wasting lot of time...Once that error occurs, if we reattempt, the build is getting through.

Any permanent solution?


Well before proposing a permanent fix , we first need to find the root cause of the problem and see where is the problem coming from. Can you share here how is the write process being done ?
karthikeyan suresh
Greenhorn

Joined: May 15, 2013
Posts: 13
Just i have executed the mvn clean install in my local directory(where the pom file exists). It trying to install the package into the local repository. Logs:

154 [main] INFO xjcmarkentity.MarkEntities - processing is: Gr2
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to write files: C:\Users\m1018785\.jenkins\workspace\PATH\TO\LOCAL\JAVA\FILE.java (Access is denied)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 57 seconds
[INFO] Finished at: Wed May 15 11:11:11 BST 2013
[INFO] Final Memory: 40M/133M
[INFO] ------------------------------------------------------------------------
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

karthikeyan suresh wrote:Just i have executed the mvn clean install in my local directory(where the pom file exists). It trying to install the package into the local repository. Logs:

154 [main] INFO xjcmarkentity.MarkEntities - processing is: Gr2
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to write files: C:\Users\m1018785\.jenkins\workspace\PATH\TO\LOCAL\JAVA\FILE.java (Access is denied)

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 minutes 57 seconds
[INFO] Finished at: Wed May 15 11:11:11 BST 2013
[INFO] Final Memory: 40M/133M
[INFO] ------------------------------------------------------------------------
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE


Can you clean your .m2 repo and test it again ?
karthikeyan suresh
Greenhorn

Joined: May 15, 2013
Posts: 13
Hi,

Yes correct. If i clean in the repo and try the issue is getting resolved. But after some time, the same issue is existing in differenct module.

Morning i faced the similar issue in one module, after that i cleaned up the repo and build it again. it is resolved.

Afternoon while trying again i am gettin the similar issue. So lot of time are getting wasted and needs to start once again from scratch.

Regards,
Karthik
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

It seems that some of your artifacts are not getting installed correctly. I have a hunch this is a configuration bug. Which IDE are you using ? Netbeans or Eclipse ?
karthikeyan suresh
Greenhorn

Joined: May 15, 2013
Posts: 13
I am using Eclipse. Repository manager we are using Artifactory.
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

Take a look at the Artifactory logs . There will be an IOException coming . Paste the recent log here (not the whole log file ) .
karthikeyan suresh
Greenhorn

Joined: May 15, 2013
Posts: 13
Access denied error
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

karthikeyan suresh wrote:Access denied error


No I want to see the whole stack trace.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Access denied Error in the Ant
 
Similar Threads
Build automation tools
Compilation overahead in WSAD 5.1
Problem with Maven configuration
Additional test directory (for integration test) - how?
setting ANT class path