ErraiApp.properties and marshalling
jervisliu Oct 18, 2012 7:07 AMHi,
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 http://127.0.0.1:8888/
org.drools.guvnor.Guvnor/Guvnor.html?gwt.codesvr=127.0.0.1:9997 @ 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
iven.brl.FieldConstraint
[ERROR] at org.jboss.errai.marshalling.rebind.api.impl.defaultjava.Defau
ltJavaMappingStrategy.marshallToJSON(DefaultJavaMappingStrategy.java:458)
[ERROR] at org.jboss.errai.marshalling.rebind.api.impl.defaultjava.Defau
ltJavaMappingStrategy$1.getMarshaller(DefaultJavaMappingStrategy.java:338)
[ERROR] at org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory
.addMarshaller(MarshallerGeneratorFactory.java:313)
[ERROR] at org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory
.generateMarshallers(MarshallerGeneratorFactory.java:296)
[ERROR] at org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory
._generate(MarshallerGeneratorFactory.java:268)
[ERROR] at org.jboss.errai.marshalling.rebind.MarshallerGeneratorFactory
.generate(MarshallerGeneratorFactory.java:142)
[ERROR] at org.jboss.errai.marshalling.rebind.MarshallersGenerator._gene
rate(MarshallersGenerator.java:359)
[ERROR] at org.jboss.errai.marshalling.rebind.MarshallersGenerator.gener
ateMarshallerBootstrapper(MarshallersGenerator.java:249)
[ERROR] at org.jboss.errai.marshalling.rebind.MarshallersGenerator.gener
ate(MarshallersGenerator.java:234)
[ERROR] at com.google.gwt.core.ext.GeneratorExtWrapper.generate(Generato
rExtWrapper.java:48)
[ERROR] at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrement
ally(GeneratorExtWrapper.java:60)
[ERROR] at com.google.gwt.dev.javac.StandardGeneratorContext.runGenerato
rIncrementally(StandardGeneratorContext.java:647)
[ERROR] at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateW
ith.java:41)
[ERROR] at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind
(StandardRebindOracle.java:78)
[ERROR] at com.google.gwt.dev.shell.StandardRebindOracle.rebind(Standard
RebindOracle.java:268)
[ERROR] at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellMod
uleSpaceHost.java:141)
[ERROR] at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:
585)
[ERROR] at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSp
ace.java:455)
[ERROR] at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.j
ava:49)
[ERROR] at com.google.gwt.core.client.GWT.create(GWT.java:97)
[ERROR] at org.jboss.errai.marshalling.client.api.MarshallerFramework.<c
linit>(MarshallerFramework.java:42)
[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(
ModuleSpace.java:654)
[ERROR] at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:
363)
[ERROR] at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(Oophm
SessionHandler.java:200)
[ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.processConnecti
on(BrowserChannelServer.java:525)
[ERROR] at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChan
nelServer.java:363)
[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?
Thanks,
Jervis