Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.5.6, 1.5.7, 1.6-beta-2
-
Fix Version/s: 1.6-rc-1, 1.5.8, 1.7-beta-1
-
Component/s: class generator
-
Labels:None
-
Environment:Windows Server 2003 R2 SP2 (virtual machine)
Intel Xeon CPU
Java 1.5.0_12
Ant 1.7.0
-
Number of attachments :
Description
I've seen this problem with 1.5.6, 1.5.7, and 1.6-beta-2.
Occasionally I am seeing a IOException "Access is denied" during <groovyc>.
The stacktrace mentions java.io.IOException: Access is denied at java.io.WinNTFileSystem.createFileExclusively(Native Method) when the groovy compiler is trying to create a temp dir (FileSystemCompiler.createTempDir).
I put code in to look for an exception that says "java.io.IOException: Access is denied". If it happens, I have it retry. I think it usually passes the second time.
An improvement would be to keep this from happening or to retry when it happens.
Here are interesting parts of the stacktrace:
: Compilation Failed at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:798) at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:531)
java.io.IOException: Access is denied at org.codehaus.groovy.ant.Groovyc.makeCompileUnit(Groovyc.java:820) at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:783) ... 170 more
Caused by: java.io.IOException: Access is denied at java.io.WinNTFileSystem.createFileExclusively(Native Method) at java.io.File.checkAndCreate(File.java:1345) at java.io.File.createTempFile(File.java:1434) at java.io.File.createTempFile(File.java:1471) at org.codehaus.groovy.tools.FileSystemCompiler.createTempDir(FileSystemCompiler.java:266) at org.codehaus.groovy.ant.Groovyc.makeCompileUnit(Groovyc.java:816) ... 171 more
— Nested Exception ---java.io.IOException: Access is denied at org.codehaus.groovy.ant.Groovyc.makeCompileUnit(Groovyc.java:820) at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:783) at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:531) 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:585) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) at org.apache.tools.ant.Task.perform(Task.java:348) at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:204) at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:153) at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:154) at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:41) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128) at com.sas.djte.library.DJTE$_buildTestware_closure3.doCall(DJTE.groovy:119) 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:585) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234) at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:271) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:845) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:58) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:142) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:150)
This is mostly the result of a Sun bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6325169.
One thing you can do is go to your temp dir and remove all "groovy-*" files and directories. Groovyc wasn't reliably deleting them in Groovy 1.6-Beta 1, and some quirks with windows still occasionally causes issues reliably deleting those files (File.delete is called but the file isn't actually deleted).