At this point i define a new property
<define-property name="restygwt.encodeDecode.useGwtJackson" values="true,false" />
And with a few changes on restygwt i was able to generate new EncodersDecoders based on GWT Jackson. :)
I am currently able to compile this new version and add it as dependency to a small gwt project that basically make 8 different async requests and print the results.
This small project works fine.
The problem is
When i try to add a new test case identical to BasicTestGwt but with the useGwtJackson property equals to true I get the following message
[INFO] Running all GwtTestCases but AnnotationResolver
[INFO] logging for HtmlUnit thread
[INFO] Rebinding com.google.gwt.core.client.impl.SchedulerImpl
[INFO] Checking rule <replace-with class='com.github.nmorel.gwtjackson.client.JsonSerializationContext.DefaultBuilder'/>
[INFO] [WARN] Unknown type 'com.github.nmorel.gwtjackson.client.JsonSerializationContext.Builder' specified in deferred binding rule
[INFO] Checking rule <generate-with class='com.github.nmorel.gwtjackson.rebind.ObjectMapperGenerator'/>
[INFO] [WARN] Unknown type 'com.github.nmorel.gwtjackson.client.ObjectWriter' specified in deferred binding rule
[INFO] Rebinding com.google.gwt.junit.client.impl.JUnitHost
[INFO] Checking rule <replace-with class='com.github.nmorel.gwtjackson.client.JsonSerializationContext.DefaultBuilder'/>
[INFO] [WARN] Unknown type 'com.github.nmorel.gwtjackson.client.JsonSerializationContext.Builder' specified in deferred binding rule
[INFO] Checking rule <generate-with class='com.github.nmorel.gwtjackson.rebind.ObjectMapperGenerator'/>
[INFO] [WARN] Unknown type 'com.github.nmorel.gwtjackson.client.ObjectWriter' specified in deferred binding rule
[INFO] Rebinding com.google.gwt.user.client.impl.WindowImpl
[INFO] Checking rule <replace-with class='com.github.nmorel.gwtjackson.client.JsonSerializationContext.DefaultBuilder'/>
[INFO] [WARN] Unknown type 'com.github.nmorel.gwtjackson.client.JsonSerializationContext.Builder' specified in deferred binding rule
[INFO] Checking rule <generate-with class='com.github.nmorel.gwtjackson.rebind.ObjectMapperGenerator'/>
[INFO] [WARN] Unknown type 'com.github.nmorel.gwtjackson.client.ObjectWriter' specified in deferred binding rule
[INFO] Rebinding org.fusesource.restygwt.client.basic.ExampleService
[INFO] Adding '2' new generated units
[INFO] Resolving org.fusesource.restygwt.client.basic.ExampleDto_Gen_GwtJackEncDec_.GwtJackMapper
[INFO] Found type 'org.fusesource.restygwt.client.basic.ExampleDto_Gen_GwtJackEncDec_.GwtJackMapper'
[INFO] [ERROR] Unable to resolve class com/github/nmorel/gwtjackson/client/ObjectMapper
[INFO] Rebinding com.google.gwt.logging.client.LogConfiguration.LogConfigurationImplNull
[INFO] Checking rule <replace-with class='com.github.nmorel.gwtjackson.client.JsonSerializationContext.DefaultBuilder'/>
[INFO] [WARN] Unknown type 'com.github.nmorel.gwtjackson.client.JsonSerializationContext.Builder' specified in deferred binding rule
[INFO] Checking rule <generate-with class='com.github.nmorel.gwtjackson.rebind.ObjectMapperGenerator'/>
[INFO] [WARN] Unknown type 'com.github.nmorel.gwtjackson.client.ObjectWriter' specified in deferred binding rule
[INFO] Rebinding org.fusesource.restygwt.client.basic.ExampleDto_Gen_GwtJackEncDec_.GwtJackMapper
[INFO] Checking rule <replace-with class='com.github.nmorel.gwtjackson.client.JsonSerializationContext.DefaultBuilder'/>
[INFO] [WARN] Unknown type 'com.github.nmorel.gwtjackson.client.JsonSerializationContext.Builder' specified in deferred binding rule
[INFO] Checking rule <generate-with class='com.github.nmorel.gwtjackson.rebind.ObjectMapperGenerator'/>
[INFO] [WARN] Unknown type 'com.github.nmorel.gwtjackson.client.ObjectWriter' specified in deferred binding rule
[INFO] [ERROR] Deferred binding result type 'org.fusesource.restygwt.client.basic.ExampleDto_Gen_GwtJackEncDec_.GwtJackMapper' should not be abstract
[INFO] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 13.186 sec <<< FAILURE!
We can observe classloader issues on the beggining of the process
[INFO] Checking rule <replace-with class='com.github.nmorel.gwtjackson.client.JsonSerializationContext.DefaultBuilder'/>
[INFO] [WARN] Unknown type 'com.github.nmorel.gwtjackson.client.JsonSerializationContext.Builder' specified in deferred binding rule
And finally
[INFO] Rebinding org.fusesource.restygwt.client.basic.ExampleService
[INFO] Adding '2' new generated units
[INFO] Resolving org.fusesource.restygwt.client.basic.ExampleDto_Gen_GwtJackEncDec_.GwtJackMapper
[INFO] Found type 'org.fusesource.restygwt.client.basic.ExampleDto_Gen_GwtJackEncDec_.GwtJackMapper'
[INFO] [ERROR] Unable to resolve class com/github/nmorel/gwtjackson/client/ObjectMapper
I already inspected the generated classes and it is fine.
I already inspected the maven with -X and the gwt-jackson jars are in the classpath.
The same behavior is present in other bigger gwt project with a large set of dependencies. As so i am not inclined to believe that this is a GWTTestCase issue but a classloader issue with gwt-jackson.
I currently believe that there is some dependency that is preventing gwt-jackson from loading.
Does anyone have some clue about what is going on?
--
Lucas Machado