1.7-rc-1 Could not generate a proxy class for class org.gradle.process.internal.DefaultExecAction.

After updating to 1.7-rc-1 I’m seeing a problem:

Exception in thread “Thread-4” java.lang.Error: Project2 build threw org.gradle.api.GradleException: Could not generate a proxy class for class org.gradle.process.internal.DefaultExecAction.

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)

at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:71)

at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:81)

at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)

at build_5umkhjvp2j3hagg0bren1ca33m$1.run(C:\Users\scott.palmer\dev\Kayak\HGPlugins_MASTER\build.gradle:239)

I have a tree full of gradle projects in various subdirectories. They are not gradle sub-projects, each is an individual project - but they do have a sort of dependency on each other that is outside the scope of what gradle deals with. I have a gradle script that I use to find all of the projects and build them in the right order (there are other files in each project folder that I scan to figure out the build order… setting this up for gradle to figure out was too complex).

Anyway the script launches a new gradle command line (“cmd \c gradle.bat XXXXXX”) in the folder for each project using a pool of worker threads so that a few builds happen in parallel. (Again gradle might have a better way to handle this, but at the time this was the simplest solution)

It seems that my script now fails 100% of the time on the first or second project it tries to start. So the first build starts in worker thread 1, then the second build that starts in a different worker thread fails. Sometimes it is the first build that fails with the same error. It appears to be some sort of race condition. Exception in thread “Thread-3” java.lang.Error: Project1 build threw org.gradle.api.GradleException: Could not generate a proxy class for class org.gradle.process.internal.DefaultExecAction.

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at …

Each gradle build runs in a new command interpreter. This is all on Windows 7.

I can run the same gradle command line in the projects manually and they build fine. If I let the script continue, all the other projects (100+) seem to build okay. (Building about 6 at a time in parallel.)

I have already deleted the .gradle folder in all of the projects. It had no effect.

Scott

Hi,

I think this is something we have already fixed for rc-2 (out in the next day or two).

Is there anything more to the stack trace? I’m looking for a message about trying to define a duplicate class.

No, that is all I have for the stack trace.

Hi Scott,

Have you had a chance to try with rc2? This should be fixed.

Yes, thanks. This appears to be fixed.