10 Replies Latest reply: May 23, 2012 8:26 AM by Christian Sadilek RSS

    errai 2.0.1-SNAPSHOT + GWT 2.4 = java.lang.ClassNotFoundException: com.google.common.reflect.TypeToken

    Michael Anstis Newbie

      Hi,

       

      I posted this to the IRC channel and include here to maximise exposure:-

       

      Using 2.0.1-SNAPSHOT and GWT2.4 fails to compile our web-app:-

       

      [INFO] Compiling module org.drools.guvnor.FastCompiledGuvnorNGShowcase

      [ERROR] SLF4J: Class path contains multiple SLF4J bindings.

      [ERROR] SLF4J: Found binding in [jar:file:/home/manstis/.m2/repository/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]

      [ERROR] SLF4J: Found binding in [jar:file:/home/manstis/.m2/repository/org/jboss/weld/servlet/weld-servlet/1.1.6.Final/weld-servlet-1.1.6.Final.jar!/org/slf4j/impl/StaticLoggerBinder.class]

      [ERROR] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

      [INFO]    Scanning for additional dependencies: jar:file:/home/manstis/.m2/repository/org/jboss/errai/errai-ioc/2.0.1-SNAPSHOT/errai-ioc-2.0.1-SNAPSHOT.jar!/org/jboss/errai/ioc/client/Container.java

      [INFO]       Computing all possible rebind results for 'org.jboss.errai.ioc.client.Bootstrapper'

      [INFO]          Rebinding org.jboss.errai.ioc.client.Bootstrapper

      [INFO]             Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator

      [INFO]                Generating Extensions Bootstrapper...

      [INFO]                Checking ErraiApp.properties for configured types ...

      [ERROR] java.lang.NoClassDefFoundError: com/google/common/reflect/TypeToken

      [ERROR]     at org.jboss.errai.codegen.meta.impl.java.JavaReflectionMethod.getParameters(JavaReflectionMethod.java:64)

      [ERROR]     at org.jboss.errai.enterprise.rebind.JSR299IOCExtensionConfigurator.configure(JSR299IOCExtensionConfigurator.java:53)

      [ERROR]     at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator.initializeProviders(IOCBootstrapGenerator.java:333)

      [ERROR]     at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator._generate(IOCBootstrapGenerator.java:258)

      [ERROR]     at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCBootstrapGenerator.generate(IOCBootstrapGenerator.java:186)

      [ERROR]     at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator.generateIOCBootstrapClass(IOCGenerator.java:94)

      [ERROR]     at org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator.generate(IOCGenerator.java:65)

      [ERROR]     at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48)

      [ERROR]     at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60)

      [ERROR]     at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:647)

      [ERROR]     at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)

      [ERROR]     at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78)

      [ERROR]     at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:268)

      [ERROR]     at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:257)

      [ERROR]     at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)

      [ERROR]     at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:96)

      [ERROR]     at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:254)

      [ERROR]     at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)

      [ERROR]     at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:173)

      [ERROR]     at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:288)

      [ERROR]     at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$400(AbstractCompiler.java:139)

      [ERROR]     at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:588)

      [ERROR]     at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:97)

      [ERROR]     at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:52)

      [ERROR]     at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:569)

      [ERROR]     at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:33)

      [ERROR]     at com.google.gwt.dev.Precompile.precompile(Precompile.java:284)

      [ERROR]     at com.google.gwt.dev.Precompile.precompile(Precompile.java:233)

      [ERROR]     at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)

      [ERROR]     at com.google.gwt.dev.Compiler.run(Compiler.java:232)

      [ERROR]     at com.google.gwt.dev.Compiler.run(Compiler.java:198)

      [ERROR]     at com.google.gwt.dev.Compiler$1.run(Compiler.java:170)

      [ERROR]     at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88)

      [ERROR]     at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82)

      [ERROR]     at com.google.gwt.dev.Compiler.main(Compiler.java:177)

      [ERROR] Caused by: java.lang.ClassNotFoundException: com.google.common.reflect.TypeToken

      [ERROR]     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

      [ERROR]     at java.security.AccessController.doPrivileged(Native Method)

      [INFO]                [ERROR] Error generating extensions

      [ERROR]     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

      [ERROR]     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

       

      The missing class, I suspect has been removed from com.google.guava r06 (used by Errai's SNAPSHOT).

       

      Adding an artifical dependency in our POM for com.google.guava 12.0 solves the problem.

       

      With kind regards,

       

      Mike