gpt4 book ai didi

java - jasper grails 插件升级到 Java8 失败

转载 作者:行者123 更新时间:2023-12-01 09:09:58 25 4
gpt4 key购买 nike

我想升级我的 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 的网站确定他们的 .jar 是否应该能够支持 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)

最佳答案

尽管我看到其他人发帖说更新版本的 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。

关于java - jasper grails 插件升级到 Java8 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40980576/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com