无法将类'java.lang.String'的对象jar转换为类'java.util.Map'。从Grails 3.0.10升级到3.1.11时

时间:2016-09-12 13:33:54

标签: grails gradle

我正在将我的应用程序从grails 3.0.10升级到3.1.11。当我运行$1命令时,它在读取grails clean文件夹依赖项时显示以下错误。

|初始化类路径时出错:无法转换对象'文件:/root/.gradle/caches/modules-2/files-2.1/com.nnacres.nncore/ana/1.8.2/8f6699fd8c146236789f7672ee0a1df9718b259d/ana-1.8.2.jar文件: /root/.gradle/caches/modules-2/files-2.1/com.nnacres.nncore/fatFooter/1.8.2/937af4c115732e561234aa6e42876f6aa394082a/fatFooter-1.8.2.jar文件:/root/.gradle/caches/modules-2 /files-2.1/com.nnacres.nncore/widgetManager/2.4/bc8d041cc451cbca85e89596a9b9050880e2aa26/widgetManager-2.4.jar文件:/root/.gradle/caches/modules-2/files-2.1/com.nnacres.nncore/pdCommon/1.1pojo /cc4b09b66fcb0ec3cd738dbbb47026bb42eb1c/pdCommon-1.1pojo.jar文件:/root/.gradle/caches/modules-2/files-2.1/com.nnacres.nncore.grailscore/grailscore/2.8.1/9eecb9f37cf1b0908ae73360144328d45ff3759d/grailscore-2.8.1.jar文件:/root/.gradle/caches/modules-2/files-2.1/com.nnacres.nncore/jsCss/1.3pojotemp/c203c8e38668a6c593ff2765a845ed8776866152/jsCss-1.3pojotemp.jar文件:/root/.gradle/caches/modules-2 /files-2.1/xml-apis/xml-apis/1.4.01/3789d9fada 2d3d458c4ba2de349d48780f381ee3 / xml-apis-1.4.01.jar文件:/root/.gradle/caches/modules-2/files-2.1/org.grails.plugins/asset-pipeline/3.2.1/32a127d37d6deeac5916b256db8b0fe8b3a9a9ad/asset-pipeline-3.2 .1.jar文件:/root/.gradle/caches/modules-2/files-2.1/mysql/mysql-connector-java/5.1.38/dbbd7cd309ce167ec8367de4e41c63c2c8593cc5/mysql-connector-java-5.1.38.jar文件:/ root / .gradle / caches / modules-2 / files-2.1 / org.grails / grails-plugin-testing / 3.1.11 / ced629bc229c0d9b463a958ad2770eb4f4a85443 / grails-plugin-testing-3.1.11.jar file:/root/.gradle/ caches / modules-2 / files-2.1 / net.java.dev.jna / jna-platform / 4.1.0 / 23457ad1cf75c2c16763330de5565a0e67b4bc0a / jna-platform-4.1.0.jar文件:/root/.gradle/caches/modules-2 /files-2.1/org.objenesis/objenesis/2.1/87c0ea803b69252868d09308b4618f766f135a96/objenesis-2.1.jar'将类'java.lang.String'改为类'java.util.Map'

at org.grails.cli.gradle.cache.MapReadingCachedGradleOperation.readFromCached(MapReadingCachedGradleOperation.groovy:37)     在org.grails.cli.gradle.cache.MapReadingCachedGradleOperation.readFromCached(MapReadingCachedGradleOperation.groovy)     在org.grails.cli.gradle.cache.CachedGradleOperation.call(CachedGradleOperation.groovy:58)     在org.grails.cli.GrailsCli.populateContextLoader(GrailsCli.groovy:521)     在org.grails.cli.GrailsCli.initializeProfile(GrailsCli.groovy:504)     在org.grails.cli.GrailsCli.initializeApplication(GrailsCli.groovy:310)     在org.grails.cli.GrailsCli.execute(GrailsCli.groovy:273)     在org.grails.cli.GrailsCli.main(GrailsCli.groovy:163)

我还删除了.gradle文件夹,但仍显示错误

1 个答案:

答案 0 :(得分:2)

我已经通过在我的机器上安装gradle 2.13解决了这个问题,然后运行 gradle clean 命令。您可以从这里下载gradle(http://wiki.deister.net/wiki/Linux:CentOS_install_gradle

如果这样做无效,请尝试删除您当地的 .gradle 缓存文件夹,然后在您的Grails代码中运行gradle clean。