Nicozan-Blog

Knowledge Seeking

Drools and Gwt – Small Post, Big Issue May 11, 2011

Filed under: Drools,GWT — nicozan @ 3:47 pm
Tags: , , ,

Short Approach…

It’s an excellent idea to combine 2 two technologies such as Drools and GWT to build Intelligent Web Applications. But there is a little bit of a problem at the moment to integrate them. Because Drools and GWT include the org.eclipse.jdt classes but with different JDT version. And when you run your application (mvn gwt:run) you will have an error like this:

Unable to parse module: com.google.gwt.user.User
java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult.getErrors()
[Lorg/eclipse/jdt/core/compiler/IProblem;
at com.google.gwt.dev.jdt.AbstractCompiler$ICompilerRequestorImpl.
acceptResult(AbstractCompiler.java:213)
at org.eclipse.jdt.internal.compiler.Compiler.compile
(Compiler.java:417)
...

Solution…

So to solve this problem you need to add an exclusion to your dependecy (that has the Drools-Core dependency) added in your Maven Gwt Application pom.xml. The exclusion in your pom should look like this:

<dependencies>
    [...]
<dependency>
           <groupId>com.wordpress.nicozan</groupId>
           <artifactId>dependency-with-drools-core</artifactId>
           <version>1.0</version>
           <exclusions>
                   <exclusion>
                           <groupId>org.eclipse.jdt.core.compiler</groupId>
                           <artifactId>ecj</artifactId>
                   </exclusion>
           </exclusions>
</dependency>
    [...]
</dependencies>

Short but helpful 😉

Advertisements