Grails GPARS upgrade
I am using Grails 1.4.0.M1 and I am trying to upgrade the version of gpars to use with my app.
So I added in BuildConfig.groovy:
dependencies{
build 'org.codehaus.gpars:gpars:0.11'
}
This however brings me the following exception when I use run-app:
Exception in thread "Thread-4" java.lang.ClassCastException: groovyx.gpars.ThreadLocalPools cannot be cast to groovy.lang.GroovyObject
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at groovyx.gpars.Parallelizer.retrieveCurrentPool(开发者_如何学CParallelizer.groovy:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
I suspect it could be linked to the grails framework using this lib in an older version and the versions being incompatible.
Any idea how I could overcome this issue?
Thanks.
Right, Grails was using an older version of GPars (v0.9), but in a very limited way. Unfortunately it was added to the boot classpath in a way that would be nontrivial to remove or replace, so I reworked that code using regular thread management code and removed the dependency.
If you upgrade to 2.0.0.M1 the dependency is gone and you can use whatever version of GPars you like.
精彩评论