在IntelliJ Grails项目中,我在使用外部JAR GPars时遇到了很多问题。我认为这是一个指定依赖项的问题。我正在使用GPars-1.0.0。我将它保存在lib目录中,并使用IntelliJ图形用户界面-- Project Structure -> Module -> Add将其作为依赖项包括在内。I synchronized。我也尝试过adding directly to BuildConfig.groovy:
dependencies {
compile 'org.codehaus.gpars:gpars:1.0.0'
}当我输入的时候,我得到了代码帮助,它就编译了。但是当我运行以下命令时:
import static groovyx.gpars.*
...
GParsPool.withPool {
[1, 2, 3, 4, 5].eachParallel { println it }
}我收到"GParsePool.withPool“语句的ClassNotFoundException消息jsr166y.ForkJoinPool
Line | Method
->> 156 | findClass in org.codehaus.groovy.tools.RootLoader
| 306 | loadClass in java.lang.ClassLoader
| 128 | loadClass . . . . . . . . in org.codehaus.groovy.tools.RootLoader
| 247 | loadClass in java.lang.ClassLoader
| 2427 | privateGetDeclaredMethods in java.lang.Class
| 1791 | getDeclaredMethods in ''
| 46 | getLocked . . . . . . . . in org.codehaus.groovy.util.LazyReference
| 33 | get in ''
| 80 | load . . . . . . . . . . in allison.zipcode.ZipcodeService$$ENsSBrUW
| 30 | load in allison.zipcode.CountryController
| 195 | doFilter . . . . . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 886 | runTask . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 680 | run . . . . . . . . . . . in java.lang.Thread有什么想法吗?我是否在BuildConfig中正确指定了依赖项?我的代码示例可能是错误的,但它似乎遵循this example。
发布于 2012-12-24 04:39:43
弄清楚了:我没有包括jsr166y.jar
compile "org.codehaus.jsr166-mirror:jsr166y:1.7.0"https://stackoverflow.com/questions/14014404
复制相似问题