jasper grails 插件升级到 Java8 失败

Upgrade to Java8 failing for jasper grails plugin

我想升级我的 grails 服务器以使用 Java 8 而不是 7。升级时,我遇到了如下所示的异常。其他报告过类似错误的人说可以通过更改 IDE 的 Java 版本来解决问题,但这似乎不适用于这里,因为如果我 运行 从命令行或 Intellij 获取 grails。其他人报告说升级 tomcat 会有帮助,所以我使用的是最新版本 7。

我的 java home 设置为 Java 8,我已将编译器的 source/target 更改为 1.8 以确保没有任何内容进入。我已清除所有.class 文件、refreshed-dependencies、clean-all、rm .slcache 等似乎没有任何影响。

BuildConfig.groovy:        compile ":jasper:1.11.0"
BuildConfig.groovy:        build ":tomcat:7.0.70"
BuildConfig.groovy:grails.project.target.level = 1.8
BuildConfig.groovy:grails.project.source.level = 1.8

请注意,此插件使用的是 Jasperreports 5.6.1。我无法从 TIBCO 的网站确定他们的 .jars 是否应该或不应该能够支持 Java 8。另外,我正在使用 grails 2.5.5 并且我在 OSX。

2016-12-05 12:51:56,060 [http-bio-8091-exec-5] ERROR design.JRJdtCompiler  - Compilation error
org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException
    at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.<init>(ClassFileReader.java:372)
    at net.sf.jasperreports.engine.design.JRJdtCompiler.findType(JRJdtCompiler.java:255)
    at net.sf.jasperreports.engine.design.JRJdtCompiler.findType(JRJdtCompiler.java:192)
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:113)
    at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:49)
    at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:122)
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromTypeSignature(LookupEnvironment.java:1335)
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromVariantTypeSignature(LookupEnvironment.java:1391)
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeArgumentsFromSignature(LookupEnvironment.java:1172)
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromTypeSignature(LookupEnvironment.java:1340)
    at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createMethod(BinaryTypeBinding.java:550)
    at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createMethods(BinaryTypeBinding.java:630)
    at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.cachePartsFrom(BinaryTypeBinding.java:365)
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:688)
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:667)
    at org.eclipse.jdt.internal.compiler.Compiler.accept(Compiler.java:296)
    at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:118)
    at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:49)
    at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:122)
    at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getType(PackageBinding.java:137)
    at org.eclipse.jdt.internal.compiler.lookup.Scope.findType(Scope.java:1611)
    at org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2708)
    at org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:2405)
    at org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:44)
    at org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:132)
    at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:204)
    at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:1477)
    at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.methods(SourceTypeBinding.java:1175)
    at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.faultInTypesForFieldsAndMethods(SourceTypeBinding.java:678)
    at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:469)
    at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:756)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:468)
    at net.sf.jasperreports.engine.design.JRJdtCompiler.compileUnits(JRJdtCompiler.java:167)
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:201)
    at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:354)
    at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:614)
    at gdbxt.JasperReportJavaService.$tt__compileReport(JasperReportJavaService.groovy:31)
    at gdbxt.ProteinPurificationBatchController$$EQ4X8VQ0.createReport(ProteinPurificationBatchController.groovy:102)
    at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
    at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Error 
|
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
1. The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
/*
^
1 errors

Error |
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:204)
Error |
    at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:354)
Error |
    at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:614)
Error |
    at net.sf.jasperreports.engine.JasperCompileManager$compileReport.call(Unknown Source)
Error |
    at gdbxt.JasperReportJavaService.$tt__compileReport(JasperReportJavaService.groovy:31)

尽管我看到其他人 post 认为更新版本的 Tomcat 7 可以工作,但更新到 Tomcat 8 似乎对我有用。

BuildConfig.groovy:        build ":tomcat:8.0.33"

在尝试 tomcat 7.0.70 之前,我一直在尝试 tomcat 7.0.55。如果 tomcat 7.0.70 应该工作而 7.0.55 没有,那么问题可能是一些旧的 7.0.55 jar 被 7.0.70 拾取了。