3 Replies Latest reply on Oct 22, 2012 11:48 AM by Jonathan Fuerth

    ErraiApp.properties and marshalling

    Jervis Liu Apprentice



      In Guvnor we have two Errai related modules,  droolsjbpm-ide-common and drools-guvnor-webapp. droolsjbpm-ide-common module contains the object models that will be used by drools-guvnor-webapp. I added ErraiApp.properties under drools-guvnor-webapp, after some tunning with ErraiApp.properties file, whole project compiled.


      I ran into marshalling problems when I ran drools-guvnor-webapp from mvn gwt:run and from eclipse hosted mode. Both complained:


      [ERROR] 1945 [Code server for org.drools.guvnor.Guvnor from Mozilla/5.0 (Windows

      NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1 on

      org.drools.guvnor.Guvnor/Guvnor.html?gwt.codesvr= @ V!\X!Y5Lmq;tLl

      69] INFO org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory - generat

      ing marshalling class...

      [ERROR] org.jboss.errai.marshalling.client.api.exceptions.NoAvailableMarshallerE

      xception: no available marshaller for type: org.drools.ide.common.client.modeldr


      [ERROR]         at org.jboss.errai.marshalling.rebind.api.impl.defaultjava.Defau


      [ERROR]         at org.jboss.errai.marshalling.rebind.api.impl.defaultjava.Defau


      [ERROR]         at org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory


      [ERROR]         at org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory


      [ERROR]         at org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory


      [ERROR]         at org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory


      [ERROR]         at org.jboss.errai.marshalling.rebind.MarshallersGenerator._gene


      [ERROR]         at org.jboss.errai.marshalling.rebind.MarshallersGenerator.gener


      [ERROR]         at org.jboss.errai.marshalling.rebind.MarshallersGenerator.gener


      [ERROR]         at com.google.gwt.core.ext.GeneratorExtWrapper.generate(Generato


      [ERROR]         at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrement


      [ERROR]         at com.google.gwt.dev.javac.StandardGeneratorContext.runGenerato


      [ERROR]         at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateW


      [ERROR]         at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind


      [ERROR]         at com.google.gwt.dev.shell.StandardRebindOracle.rebind(Standard


      [ERROR]         at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellMod


      [ERROR]         at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:


      [ERROR]         at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSp


      [ERROR]         at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.j


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

      [ERROR]         at org.jboss.errai.marshalling.client.api.MarshallerFramework.<c


      [ERROR]         at java.lang.Class.forName0(Native Method)

      [ERROR]         at java.lang.Class.forName(Class.java:247)

      [ERROR]         at com.google.gwt.dev.shell.ModuleSpace.loadClassFromSourceName(


      [ERROR]         at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:


      [ERROR]         at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(Oophm


      [ERROR]         at com.google.gwt.dev.shell.BrowserChannelServer.processConnecti


      [ERROR]         at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChan


      [ERROR]         at java.lang.Thread.run(Thread.java:662)

      [INFO] ------------------------------------------------------------------------


      I verified dir guvnor-webapp-drools\target\guvnor-webapp-drools-5.5.0-SNAPSHOT\WEB-INF\classes, this dir indeed has the ErraiApp.properties. I read the doc about where to put ErraiApp.properties (https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties), but I am not sure if I interprete it correctly, especially this line:

      "An ErraiApp.properties file must appear at the root of each classpath location that contains an Errai module. The contents of JAR and directory classpath entries that do not contain an ErraiApp.properties are effectively invisible to Errai's classpath scanner."


      Does this mean I have to add ErraiApp.properties under droolsjbpm-ide-common module as well? Well, I did try, but this did not help. Am I still missing anything?




        • 1. Re: ErraiApp.properties and marshalling
          Jonathan Fuerth Master

          Yes, you will need an ErraiApp.properties in droolsjbpm-ide-common if it contains types annotated with @Portable. Since you're using Maven to build, it should go in src/main/resources. Is that where you put it?



          • 2. Re: ErraiApp.properties and marshalling
            Jervis Liu Apprentice

            Yes, I did put an ErraiApp.properties in droolsjbpm-ide-common/src/main/resources. Though this module does not use @Portable annotation as its a module potentially can be shared by several projects and we do not want to introduce Errai dependency to this module right now. In short, droolsjbpm-ide-common contains ErraiApp.properties, but it is not an Errai project. I verified the droolsjbpm-ide-common.jar generated by maven, the jar indeed has an ErraiApp.properties under the root directory of the jar.


            Anyway, when I start Guvnor from eclipse or from mvn gwt:run, it wont start and complains "no available marshaller for type: org.drools.ide.common.client.modeldriven.brl.FieldConstraint". Note, FieldConstraint is an interface, all its implementations resides in droolsjbpm-ide-common module. Also note, the compiler works alright. Guvnor module uses several classes from droolsjbpm-ide-common, the compile fails with marshalling errors if the content of the ErraiApp.properties is not correct. So this means errai indeed picks up ErraiApp.properties during the compile time.

            • 3. Re: ErraiApp.properties and marshalling
              Jonathan Fuerth Master

              Hmm, my next suggestion would be to ensure the types you need from droolsjbpm-ide-common are in a GWT module. But since you're having no trouble with the production mode compile, I guess they must be in a GWT module.


              So that leaves me thinking there must be a classpath difference between the production build (which works) and the dev mode build (which misses all implementations of FieldConstraint.) Can you take a look at the full classpath in both cases and see if there's something missing (or even out-of-order) in the dev mode classpath?