Thursday, May 21, 2009

JBoss Drools and GWT 1.6.4 classpath conflict

If you're doing a project with GWT 1.6.4 and you also use JBOSS Drools you will have to exclude the Drools libs from the classpath when compiling java to Javascript with GWT, as it throws a proud representative of the jar hell:

[java] [ERROR] Unexpected
[java] java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.looku
p.ProblemReferenceBinding.closestReferenceMatch()Lorg/eclipse/jdt/internal/compi
ler/lookup/ReferenceBinding;
[java] at com.google.gwt.dev.javac.JsniChecker$CheckingVisitor.findClas
s(JsniChecker.java:231)
[java] at com.google.gwt.dev.javac.JsniChecker$CheckingVisitor.checkRef
s(JsniChecker.java:142)
[java] at com.google.gwt.dev.javac.JsniChecker$CheckingVisitor.endVisit
(JsniChecker.java:65)
[java] at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.trave
rse(MethodDeclaration.java:227)
[java] at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.travers
e(TypeDeclaration.java:1149)
[java] at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclarat
ion.traverse(CompilationUnitDeclaration.java:487)
[java] at com.google.gwt.dev.javac.JsniChecker.check(JsniChecker.java:3
50)
[java] at com.google.gwt.dev.javac.JsniChecker.check(JsniChecker.java:3
40)
[java] at com.google.gwt.dev.javac.CompilationUnitInvalidator.validateC
ompilationUnits(CompilationUnitInvalidator.java:159)
[java] at com.google.gwt.dev.javac.CompilationState.compile(Compilation
State.java:198)
[java] at com.google.gwt.dev.javac.CompilationState.refresh(Compilation
State.java:178)
[java] at com.google.gwt.dev.javac.CompilationState.(CompilationS
tate.java:93)
[java] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDe
f.java:264)
[java] at com.google.gwt.dev.Precompile.precompile(Precompile.java:283)

[java] at com.google.gwt.dev.Compiler.run(Compiler.java:170)
[java] at com.google.gwt.dev.Compiler$1.run(Compiler.java:124)
[java] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.
java:84)
[java] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger
(CompileTaskRunner.java:78)
[java] at com.google.gwt.dev.Compiler.main(Compiler.java:131)