2 Replies Latest reply on May 9, 2012 2:12 AM by lau_bakman

    Errai Bus 2.0 Final and IntelliJ - help

    lau_bakman

      Hi

       

      I have been working for a while with Errai Bus and I am a very happy user. Unfortunately I am not as happy working with Eclipse - we are having some weird issues with Eclipse in my team.

       

      We have decided to try using IntelliJ working with Errai (and since some of your videos shows you working with IntelliJ - we figured that wouldn't be a problem at all) but so far I have hit a wall doing it. I am sure that some of my issues are just because of me being new to IntelliJ but I figured that this was still a proper place to ask this question.

       

      I have downloaded IntelliJ Ultimate 11.1.1. installed it along with maven 3.0.4 and ant 1.8.3.

       

      Then I have created an Errai starter project using the following Maven command:

       

      mvn archetype:generate

           -DarchetypeGroupId=org.jboss.errai.archetypes

           -DarchetypeArtifactId=bus-quickstart

           -DarchetypeVersion=2.0.0.Final

           -DarchetypeRepository=https://repository.jboss.org/nexus/content/groups/public/

       

      and then followed the steps on https://community.jboss.org/wiki/Errai-IDESetup

       

      Building everything using Maven works flawlessly as always, building from IntelliJ (Ctrl + F9) also seems to work - or at least I think so as it reports completed successfully.

       

      Rebuilding (Build -> Rebuild Project) fails miserable (after increasing the compiler memory to 512MB)  with an NullPointerException in UnitWriteThread - seemingly originating from DiskCache.transferToStream(DiskCache.java:182). Now this surprises me, but I can work around this by using the Maven Lifecycles in the Maven Projects tool to build the project.

       

      Debugging from IntelliJ is currently what is causing me the worst headache - debugging using IntelliJ gives me the following exception stack trace:

       

      generating marshalling class...

      Reflections took 420 ms to scan 7 urls, producing 253 keys and 872 values

      Reflections took 298 ms to scan 7 urls, producing 253 keys and 872 values

      generated marshalling class in 1229ms.

      *** using temporary path: C:\Users\Lau\AppData\Local\Temp\errai\11d1208f7a4627115c63b379839c9d5e352b5df345223bf743db81ec5debe\errai.marshalling\gen ***

      generating marshalling class...

      generated marshalling class in 122ms.

      could not locate marshaller class. will attempt dynamic generation.

      generating marshalling class...

      generating IOC bootstrapping class...

      generated marshalling class in 833ms.

      [WARN] Server class 'org.eclipse.jdt.core.compiler.CompilationProgress' could not be found in the web app, but was found on the system classpath

         [WARN] Adding classpath entry 'file:/C:/Users/Lau/.m2/repository/com/google/gwt/gwt-dev/2.4.0/gwt-dev-2.4.0.jar' to the web app classpath for this session

      generated IOC bootstrapping class in 3421ms

      using IOC bootstrapping code at: C:\Users\Lau\.IntelliJIdea11\system\gwt\bus-app1.2865cf09\bus-app1.145c99aa\run\www\.errai\BootstrapperImpl.java

      java.lang.RuntimeException: Deferred binding failed for 'org.jboss.errai.ioc.client.Bootstrapper' (did you forget to inherit a required module?)

                at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53)

                at com.google.gwt.core.client.GWT.create(GWT.java:97)

                at org.jboss.errai.ioc.client.Container.boostrapContainer(Container.java:44)

                at org.jboss.errai.ioc.client.Container.onModuleLoad(Container.java:34)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396)

                at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200)

                at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525)

                at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)

                at java.lang.Thread.run(Thread.java:662)

      Caused by: com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.

                at com.google.gwt.dev.js.ast.JsVisitor.translateException(JsVisitor.java:459)

                at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:445)

                at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:419)

                at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:97)

                at com.google.gwt.dev.js.JsToStringGenerationVisitor.visit(JsToStringGenerationVisitor.java:522)

                at com.google.gwt.dev.js.ast.JsExprStmt.traverse(JsExprStmt.java:37)

                at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:443)

                at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:419)

                at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:97)

                at com.google.gwt.dev.js.JsToStringGenerationVisitor.printJsBlock(JsToStringGenerationVisitor.java:1019)

                at com.google.gwt.dev.js.JsSourceGenerationVisitor.visit(JsSourceGenerationVisitor.java:59)

                at com.google.gwt.dev.js.ast.JsBlock.traverse(JsBlock.java:43)

                at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:443)

                at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:419)

                at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:97)

                at com.google.gwt.dev.shell.Jsni.generateJavaScriptForHostedMode(Jsni.java:253)

                at com.google.gwt.dev.shell.Jsni.getJavaScriptForHostedMode(Jsni.java:241)

                at com.google.gwt.dev.shell.ModuleSpaceOOPHM.createNativeMethods(ModuleSpaceOOPHM.java:52)

                at com.google.gwt.dev.shell.CompilingClassLoader.injectJsniMethods(CompilingClassLoader.java:1302)

                at com.google.gwt.dev.shell.CompilingClassLoader.findClass(CompilingClassLoader.java:1113)

                at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

                at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

                at java.lang.Class.forName0(Native Method)

                at java.lang.Class.forName(Class.java:247)

                at com.google.gwt.dev.shell.ModuleSpace.loadClassFromSourceName(ModuleSpace.java:654)

                at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:458)

                at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)

                ... 12 more

      Caused by: com.google.gwt.dev.shell.HostedModeException: JSNI rewriter found reference to non-existent field in a method invocation: @local.test.client.local.ErraiIocTestHelper::saveStaticReference() at generated://895252F53291A41A9E2808A8B0C10820/org/jboss/errai/ioc/client/BootstrapperImpl.java(43)

                at com.google.gwt.dev.shell.Jsni$JsSourceGenWithJsniIdentFixup.visit(Jsni.java:181)

                at com.google.gwt.dev.js.ast.JsInvocation.traverse(JsInvocation.java:64)

                at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:443)

                ... 37 more

       

      Now this stacktrace tells me that for some reason the compiler generated marshaller could not be found and therefor it tries to generate new marshallers - no problems with that but to my surprise the BootstrapperImpl.java contains a reference to the ErraiIocTestHeler witch is a class in the test area??? What am I doing wrong that would include the tests in the marshaller generator but not load the class when debugging??

       

      I know this is a kind of vague question, but I would be grateful for any help getting Errai to work with IntelliJ.

       

      I can provide the full IntelliJ project if needed.

       

      Regards

       

      Lau Bakman