I got Exception
java.lang.NoSuchFieldError: reportUnusedDeclaredThrownExceptionIncludeDocCommentReference outside eclipse in mand line using maven.
The gwt libraries are declared at the top of list of dependencies and GWT 2.5.1 is being used. How to solve this issue? Please help
I got Exception
java.lang.NoSuchFieldError: reportUnusedDeclaredThrownExceptionIncludeDocCommentReference outside eclipse in mand line using maven.
The gwt libraries are declared at the top of list of dependencies and GWT 2.5.1 is being used. How to solve this issue? Please help
Share Improve this question edited Aug 1, 2013 at 10:25 Shahrzad 1,0728 silver badges26 bronze badges asked Aug 1, 2013 at 10:09 Kureem RossayeKureem Rossaye 1191 silver badge7 bronze badges 2- It looks like you're using Maven -- when are you getting this error (please provide some more context)? – Zeleres Commented Aug 2, 2013 at 15:00
- I get this error when it is piling the gwt codes using the maven gwt plugin. – Kureem Rossaye Commented Aug 5, 2013 at 12:18
2 Answers
Reset to default 8Well, I figured out what is the problem. In my pom.xml , I have this dependency
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>4.7.0</version>
The problem with this is that, jasper reports has a dependency on jdtcore
<dependency>
<artifactId>jdtcore</artifactId>
<groupId>eclipse</groupId>
<version>3.1.0</version>
</dependency>
jdtcore actually creates a conflict with the gwt piler. To solve this problem, I need to add an exclusion in the jasper dependency like this
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>4.7.0</version>
<exclusions>
<exclusion>
<artifactId>jdtcore</artifactId>
<groupId>eclipse</groupId>
</exclusion>
</exclusions>
</dependency>
Now if still need the jdtcore library in the web app (normally to dynamically pile jasper reports) we can add the dependency with scope runtime like this
<dependency>
<artifactId>jdtcore</artifactId>
<groupId>eclipse</groupId>
<version>3.1.0</version>
<scope>runtime</scope>
</dependency>
Last note, if anybody gets the problem, then should look if any dependency in pom.xml has got a dependency on jdtcore, exclude it and include it as runtime
Hope this helps
For gradle exclude transitive dependency as follows in build.gradle:
dependencies {
pile('net.sf.jasperreports:jasperreports:3.7.4') {
//Exclude as it caused problems with GWT:
//http://stackoverflow./questions/17991063/java-lang-nosuchfielderror-reportunuseddeclaredthrownexceptionincludedocment
exclude group: 'eclipse', module: 'jdtcore'
}
}
Except after I made this change my jasper pilation fails. I am not sure yet how can I get Jasper pilation and GWT pilation to coexist in same project?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744850579a4597102.html
评论列表(0条)