升级到Java8失败的jasper grails插件

时间:2016-12-05 18:08:44

标签: java grails java-8 jasper-reports grails-plugin

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

我的java home设置为Java 8,我已将编译器的源/目标更改为1.8以确保没有任何内容正在进行中。我已清除所有.class文件,刷新依赖项,全部清除,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$1.findType(JRJdtCompiler.java:255)
    at net.sf.jasperreports.engine.design.JRJdtCompiler$1.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)

1 个答案:

答案 0 :(得分:1)

即使我看到其他人发布了更新版本的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.70中有一些旧的7.0.55 jar被接收了。