S.O.S JDK 1.8 and Jasper Reports

2
Hello,
I need help.My code is running with jdk 1.6 but now,  I am using jdk 1.8 and I take the following error:
how can ı solve this problemm??  also , ı am using tomcat 7 , eclipse kepler.
 
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:109)
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:1242)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromVariantTypeSignature(LookupEnvironment.java:1298)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeArgumentsFromSignature(LookupEnvironment.java:1085)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromTypeSignature(LookupEnvironment.java:1247)
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:684)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:663)
at org.eclipse.jdt.internal.compiler.Compiler.accept(Compiler.java:296)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:114)
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:1584)
at org.eclipse.jdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2681)
at org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:2378)
at org.eclipse.jdt.internal.compiler.ast.SingleTypeReference.getTypeBinding(SingleTypeReference.java:44)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.internalResolveType(TypeReference.java:131)
at org.eclipse.jdt.internal.compiler.ast.TypeReference.resolveType(TypeReference.java:203)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.resolveTypesFor(SourceTypeBinding.java:1405)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.methods(SourceTypeBinding.java:1174)
at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.faultInTypesForFieldsAndMethods(SourceTypeBinding.java:677)
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 net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toJasperReport(JasperReportBuilder.java:279)
at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toJasperPrint(JasperReportBuilder.java:308)
at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.export(JasperReportBuilder.java:629)
at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toDocx(JasperReportBuilder.java:496)
at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toDocx(JasperReportBuilder.java:492)
at com.meta.efatura.model.service.ReportService$1.run(ReportService.java:269)
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:744)
net.sf.dynamicreports.report.exception.DRException: 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
 
at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toJasperReport(JasperReportBuilder.java:282)
at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toJasperPrint(JasperReportBuilder.java:308)
at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.export(JasperReportBuilder.java:629)
at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toDocx(JasperReportBuilder.java:496)
at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toDocx(JasperReportBuilder.java:492)
at com.meta.efatura.model.service.ReportService$1.run(ReportService.java:269)
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:744)
Caused by: 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
 
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:204)
at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:354)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:614)
at net.sf.dynamicreports.jasper.builder.JasperReportBuilder.toJasperReport(JasperReportBuilder.java:279)
... 8 more
 
ozlemkocak_1903's picture
Joined: Mar 6 2015 - 12:48am
Last seen: 4 years 4 months ago

5 Answers:

0

JDK 1.8 is a break with the previous versions.

Tomcat 7 is not "prepared" to the new version of the JDK. Even the Tomcat 8 is not fully featured...

You shouldn't do that.

 

The only way to solve it is by the fallback to 1.6 or 1.7...

nuno-miguel-lourenco's picture
Joined: Feb 23 2015 - 10:21am
Last seen: 3 years 11 months ago

thanks for your answer. I read some comments like ecj-*.jar can solve this problem. is it possible? ı must find a solution without 1.6 or 1.7

ozlemkocak_1903 - 4 years 4 months ago

The only way? You could upgrade Tomcat. Or change to a serious container that does support jdk versions that have been in production for 1 year.

ymajoros - 4 years 3 months ago

Not to mention Oracle stopped updating JDK 1.7 ....

haroldo - 4 years 1 month ago
0

thanks for your answer. I read some comments like ecj-*.jar can solve this problem. is it possible? ı must find a solution without 1.6 or 1.7

ozlemkocak_1903's picture
Joined: Mar 6 2015 - 12:48am
Last seen: 4 years 4 months ago
0

Java Options and JasperServer License Details

https://community.jaspersoft.com/documentation/tibco-jasperreports-serve...

On the supported JVM you'll see that JDK 1.8 is not referenced (https://www.jaspersoft.com/sites/default/files/Jaspersoft%20Platform%20S...).

If I'm not mistaken the class files generated by JDK 1.8 use the v.52 of the format...

Good luck with your trials to put it working. If you find a solution post it here ;)

nuno-miguel-lourenco's picture
Joined: Feb 23 2015 - 10:21am
Last seen: 3 years 11 months ago
3

I solved the problem. I added ecj-4.3.1.jar to my project and the problem is solved. Thank you nuno-miguel-lourenco for your interest :)

ozlemkocak_1903's picture
Joined: Mar 6 2015 - 12:48am
Last seen: 4 years 4 months ago

Yes, this solves it (as long as you exclude jdt). See http://community.jaspersoft.com/questions/844403/how-run-jasperreports-j...

ymajoros - 4 years 3 months ago

Thanks very much it solved the problem after update from jdk7 to jdk8 with tomcat 8

msolci - 3 years 4 months ago
0
ozlemkocak_1903 despite of the ability to put it working, which is GREAT, pay attention when deploying to production (if you have it), so that you have the ability to push your work ;)
 
Cheers and again nice work!
nuno-miguel-lourenco's picture
Joined: Feb 23 2015 - 10:21am
Last seen: 3 years 11 months ago
Feedback
randomness