JasperReports wont't work with Vaadin 8

Hi,

I wanted to use Jasper Reports on my recent Vaadin 8 project.
My problem is that as I add the Jasper Reports Dependency (Jasper Version 6.4.0) to my pom.xml my Project won’t build anymore…
I get the following error:

[ERROR] An internal compiler exception occurred [INFO] com.google.gwt.dev.jjs.InternalCompilerException: Error constructing Java AST [INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.translateException(GwtAstBuilder.java:3980) [INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.getInternalCompilerException(GwtAstBuilder.java:4387) [INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.createMembers(GwtAstBuilder.java:4079) [INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.processImpl(GwtAstBuilder.java:3912) [INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.process(GwtAstBuilder.java:3954) [INFO] at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater$UnitProcessorImpl.process(CompilationStateBuilder.java:129) [INFO] at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.process(JdtCompiler.java:384) [INFO] at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:470) [INFO] at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:1092) [INFO] at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:325) [INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:548) [INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:479) [INFO] at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:465) [INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:423) [INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:222) [INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:202) [INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:143) [INFO] at com.google.gwt.dev.Compiler.compile(Compiler.java:204) [INFO] at com.google.gwt.dev.Compiler.compile(Compiler.java:155) [INFO] at com.google.gwt.dev.Compiler.compile(Compiler.java:144) [INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:118) [INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55) [INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50) [INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:125) [INFO] Caused by: java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.lookup.MethodBinding.isDefaultMethod()Z [INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.createMethod(GwtAstBuilder.java:4174) [INFO] at com.google.gwt.dev.jjs.impl.GwtAstBuilder.createMembers(GwtAstBuilder.java:4069) [INFO] ... 21 more [INFO] [ERROR] at ComponentDetailMap.java(23): final class ComponentDetailMap extends JavaScriptObject [INFO] org.eclipse.jdt.internal.compiler.ast.TypeDeclaration I guess there’s a Version conflict in the dependencies but I wasn’t able to figure out what exactly the problem is so far…

Looks a lot like this one: https://github.com/gwtproject/gwt/issues/9467

Maybe you have old GWT dependency in your classpath?

-Olli

I cant’t find any old version of gwt in my referenced Libraries.
The only ones I can find are gwt-elemental-2.8.1 and gwt-user-2.8.1
Here’s my mvn dependency tree:

[INFO]
 --- maven-dependency-plugin:2.8:tree (default-cli) @ ContractorGUI ---

[INFO]
 0000-000:ContractorGUI:war:1.0-SNAPSHOT
[INFO]
 +- junit:junit:jar:4.11:test
[INFO]
 |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO]
 +- 0000-000:STD_Database:jar:1.0.0-SNAPSHOT:compile
[INFO]
 |  +- org.hibernate:hibernate-core:jar:5.0.7.Final:compile
[INFO]
 |  |  +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
[INFO]
 |  |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO]
 |  |  +- org.javassist:javassist:jar:3.18.1-GA:compile
[INFO]
 |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO]
 |  |  +- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
[INFO]
 |  |  +- org.jboss:jandex:jar:2.0.0.Final:compile
[INFO]
 |  |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO]
 |  |  |  \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO]
 |  |  \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO]
 |  +- org.hibernate:hibernate-entitymanager:jar:5.0.7.Final:compile
[INFO]
 |  +- mysql:mysql-connector-java:jar:5.1.37:compile
[INFO]
 |  +- javax.transaction:jta:jar:1.1:compile
[INFO]
 |  +- org.softsmithy.lib:lib-core:jar:0.1:compile
[INFO]
 |  +- com.miglayout:miglayout:jar:3.7.4:compile
[INFO]
 |  +- javax.xml.bind:jaxb-api:jar:2.2.5:compile
[INFO]
 |  +- com.sun.xml.bind:jaxb-impl:jar:2.2.5:compile
[INFO]
 |  +- commons-io:commons-io:jar:2.4:compile
[INFO]
 |  \- org.bouncycastle:bcprov-jdk15on:jar:1.51:compile
[INFO]
 +- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO]
 +- commons-beanutils:commons-beanutils:jar:1.9.2:compile
[INFO]
 |  +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO]
 |  \- commons-collections:commons-collections:jar:3.2.1:compile
[INFO]
 +- javax.servlet:javax.servlet-api:jar:3.0.1:provided
[INFO]
 +- com.vaadin:vaadin-server:jar:8.0.7:compile
[INFO]
 |  +- com.vaadin:vaadin-sass-compiler:jar:0.9.13:compile
[INFO]
 |  |  +- org.w3c.css:sac:jar:1.3:compile
[INFO]
 |  |  \- com.vaadin.external.flute:flute:jar:1.3.0.gg2:compile
[INFO]
 |  +- com.vaadin:vaadin-shared:jar:8.0.7:compile
[INFO]
 |  +- org.jsoup:jsoup:jar:1.8.3:compile
[INFO]
 |  \- com.googlecode.gentyref:gentyref:jar:1.2.0:compile
[INFO]
 +- com.vaadin:vaadin-push:jar:8.0.7:compile
[INFO]
 |  \- com.vaadin.external.atmosphere:atmosphere-runtime:jar:2.4.5.vaadin2:compile
[INFO]
 |     \- com.vaadin.external.slf4j:vaadin-slf4j-jdk14:jar:1.6.1:compile
[INFO]
 +- com.vaadin:vaadin-client:jar:8.0.7:provided
[INFO]
 |  \- com.google.gwt:gwt-elemental:jar:2.8.1:provided
[INFO]
 |     \- com.google.gwt:gwt-user:jar:2.8.1:provided
[INFO]
 |        +- com.google.jsinterop:jsinterop-annotations:jar:1.0.1:provided
[INFO]
 |        +- com.google.jsinterop:jsinterop-annotations:jar:sources:1.0.1:provided
[INFO]
 |        +- javax.validation:validation-api:jar:1.0.0.GA:provided
[INFO]
 |        \- javax.validation:validation-api:jar:sources:1.0.0.GA:provided
[INFO]
 +- com.vaadin:vaadin-themes:jar:8.0.7:compile
[INFO]
 \- net.sf.jasperreports:jasperreports:jar:6.4.0:compile
[INFO]
    +- commons-digester:commons-digester:jar:2.1:compile
[INFO]
    +- com.lowagie:itext:jar:2.1.7.js5:compile
[INFO]
    |  +- bouncycastle:bcmail-jdk14:jar:138:compile
[INFO]
    |  +- bouncycastle:bcprov-jdk14:jar:138:compile
[INFO]
    |  \- org.bouncycastle:bctsp-jdk14:jar:1.38:compile
[INFO]
    |     +- org.bouncycastle:bcprov-jdk14:jar:1.38:compile
[INFO]
    |     \- org.bouncycastle:bcmail-jdk14:jar:1.38:compile
[INFO]
    +- org.jfree:jcommon:jar:1.0.23:compile
[INFO]
    +- org.jfree:jfreechart:jar:1.0.19:compile
[INFO]
    +- org.eclipse.jdt.core.compiler:ecj:jar:4.3.1:compile
[INFO]
    +- org.codehaus.castor:castor-xml:jar:1.3.3:compile
[INFO]
    |  +- org.codehaus.castor:castor-core:jar:1.3.3:compile
[INFO]
    |  +- commons-lang:commons-lang:jar:2.6:compile
[INFO]
    |  +- javax.inject:javax.inject:jar:1:compile
[INFO]
    |  +- stax:stax:jar:1.2.0:compile
[INFO]
    |  |  \- stax:stax-api:jar:1.0.1:compile
[INFO]
    |  +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO]
    |  \- org.springframework:spring-context:jar:3.0.6.RELEASE:compile
[INFO]
    |     +- org.springframework:spring-aop:jar:3.0.6.RELEASE:compile
[INFO]
    |     |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO]
    |     +- org.springframework:spring-beans:jar:3.0.6.RELEASE:compile
[INFO]
    |     +- org.springframework:spring-core:jar:3.0.6.RELEASE:compile
[INFO]
    |     +- org.springframework:spring-expression:jar:3.0.6.RELEASE:compile
[INFO]
    |     \- org.springframework:spring-asm:jar:3.0.6.RELEASE:compile
[INFO]
    +- com.fasterxml.jackson.core:jackson-core:jar:2.1.4:compile
[INFO]
    +- com.fasterxml.jackson.core:jackson-databind:jar:2.1.4:compile
[INFO]
    +- com.fasterxml.jackson.core:jackson-annotations:jar:2.1.4:compile
[INFO]
    +- org.apache.lucene:lucene-core:jar:4.5.1:compile
[INFO]
    +- org.apache.lucene:lucene-analyzers-common:jar:4.5.1:compile
[INFO]
    +- org.apache.lucene:lucene-queryparser:jar:4.5.1:compile
[INFO]
    |  +- org.apache.lucene:lucene-queries:jar:4.5.1:compile
[INFO]
    |  \- org.apache.lucene:lucene-sandbox:jar:4.5.1:compile
[INFO]
    |     \- jakarta-regexp:jakarta-regexp:jar:1.4:compile
[INFO]
    +- org.olap4j:olap4j:jar:0.9.7.309-JS-3:compile
[INFO]
    +- com.google.zxing:core:jar:3.2.1:compile
[INFO]
    \- com.ibm.icu:icu4j:jar:57.1:compile

Hi,
try to exclude eclipse jdt compiler transitive dependency from jasperreports dependency

HTH
Marco

Did you somehow resolve this issue? What is your solution?

Hi.

for Jasper Reports 6.3.1 it could be solved by adding the “org.eclipse.jdt.core.compiler” (version 4.6.1) dependency.
It might also work for Jasper Reports 6.4.0 :slight_smile:

Olli

​<dependency>
   <groupId>net.sf.jasperreports</groupId>
   <artifactId>jasperreports</artifactId>
   <version>6.3.1</version>
</dependency>
<dependency>
   <groupId>org.eclipse.jdt.core.compiler</groupId>
   <artifactId>ecj</artifactId>
   <version>4.6.1</version>
</dependency>

Oliver Helbig:
Hi.

for Jasper Reports 6.3.1 it could be solved by adding the “org.eclipse.jdt.core.compiler” (version 4.6.1) dependency.
It might also work for Jasper Reports 6.4.0 :slight_smile:

Olli

​<dependency>
   <groupId>net.sf.jasperreports</groupId>
   <artifactId>jasperreports</artifactId>
   <version>6.3.1</version>
</dependency>
<dependency>
   <groupId>org.eclipse.jdt.core.compiler</groupId>
   <artifactId>ecj</artifactId>
   <version>4.6.1</version>
</dependency>

That solved my problem, thanks!