Re: [gwt-contrib] Re: SDM + gin + generated GinModule not working well together

2014-11-26 Thread Nicolas Morel
Thanks for the patch, it works on the hello world project I made.
However, it is still not enough for the bigger project I'm working on. I'll 
try to investigate and determine what's going on or reproduce it via a more 
complex example. 


Le vendredi 21 novembre 2014 00:04:03 UTC+1, John Stalcup a écrit :

 Though we do not make a promise to process GWT.create() of entry point 
 types before any other GWT.create() calls, it was easy to restore this 
 behavior in incremental, so I went ahead and did it (
 https://gwt-review.googlesource.com/#/c/10410/).

 You should probably find a way not to depend on this in the future, as it 
 is not promised and may change again.


 On Mon Nov 17 2014 at 2:07:02 PM Christopher Viel viel.chr...@gmail.com 
 javascript: wrote:

 Hi,

 I'm gonna add some more background here.

 The generator generates a bunch of file and binds the interfaces using 
 GIN. I would't say this is strictly necessary, but it brings the advantages 
 of DI to the generated code. So we have an Entry Point that is an interface 
 and a rebind rule. UserAgentAsserter uses a similar technique. What we also 
 do is generate a Ginjector interface and put a 
 *GWT.create(GeneratedGinjector.class)* call inside the generated entry 
 point. That way GIN's generator is called after and everything should be 
 resolvable. The generated ginjector is setup to look at a specific property 
 to load additional gin modules. Here it happens  that one of them is also 
 generated. So all of that actually work with 2.7.

 What no longer works is if the entry point and the ginjector are no 
 longer generated. If there is a GWT.create() call that resolves to a 
 Ginjector from an explicit entry point, it fails. I'm not sure I'm being 
 very clear here so here's an example:

 *MyModule.gwt.xml:*
 module
 entry-point class=com.project.EntryPointToGenerate/
 entry-point class=com.project.ExplicitEntryPoint/

 extend-configuration-property name=gin.ginjector.modules
 value=com.project.GeneratedGinModule/

 generate-with class=com.project.EntryPointGenerator
 when-type-is class=com.project.EntryPointToGenerate/
 /generate-with
 /module

 *EntryPointToGenerate:*
 public interface EntryPointToGenerate extends EntryPoint {}

 *EntryPointGenerator*: Generates *com.project.GeneratedGinModule* and an 
 implementation of *EntryPointToGenerate*

 *ExplicitEntryPoint*: 
 public class ExplicitEntryPoint implements EntryPoint {
 private static final ExplicitGinjector GINJECTOR = GWT.create(
 ExplicitGinjector.class);

 @Override
 public void onModuleLoad() {}
 }

 *ExplicitGinjector:*
 @GinModules( value = ExplicitGinModule.class, properties = 
 gin.ginjector.modules )
 public interface ExplicitGinjector extends Ginjector {
 /* snip */
 }

 With this code in a regular compilation, EntryPointToGenerate is 
 generated before ExplicitEntryPoint is traversed. With incremental 
 compilation, ExplicitEntryPoint is traversed (and incidentally GINs 
 generator is called) before EntryPointGenerator is called. I would expect 
 the first entry point to be traversed at first, even if it means calling a 
 generator.

 On Sunday, November 16, 2014 3:56:20 PM UTC-5, Nicolas Morel wrote:

 Hi, 

 I'm currently testing GWT 2.7.0-rc1 and one of my project using GWTP 
 Rest-Dispatch https://github.com/ArcBees/GWTP/wiki/Rest-Dispatch is 
 not working under SDM. 
 The compilation fails with this error : 

   [ERROR] Unable to load gin module type 
 [com.gwtplatform.dispatch.rest.client.RestGinModule], maybe you haven't 
 compiled your client java sources?
 java.lang.ClassNotFoundException: com$gwtplatform$dispatch$rest$
 client$RestGinModule
 at com.google.gwt.inject.rebind.GinBridgeClassLoader.findClass(
 GinBridgeClassLoader.java:150)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
 at com.google.gwt.inject.rebind.GinBridgeClassLoader.loadClass(
 GinBridgeClassLoader.java:108)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:340)
 at com.google.gwt.inject.rebind.GinjectorGenerator.loadClass(
 GinjectorGenerator.java:223)
 at com.google.gwt.inject.rebind.GinjectorGenerator.
 getPropertyModuleClasses(GinjectorGenerator.java:137)
 at com.google.gwt.inject.rebind.GinjectorGenerator.getModuleClasses(
 GinjectorGenerator.java:116)
 at com.google.gwt.inject.rebind.GinjectorGenerator.generate(
 GinjectorGenerator.java:72)
 at com.google.gwt.core.ext.IncrementalGenerator.
 generateNonIncrementally(IncrementalGenerator.java:40)

 The full stack trace is available in attachment.

 The problem has been reported to the GWTP team here 
 https://github.com/ArcBees/GWTP/issues/614. The normal compilation 
 works but not the incremental compile from SDM.

 I made a simple example available here 
 https://github.com/nmorel/hello-gwt-rest-dispatch.

 From what I saw, the RestGinModule that gin is trying 

Re: [gwt-contrib] Re: SDM + gin + generated GinModule not working well together

2014-11-20 Thread 'John Stalcup' via GWT Contributors
Though we do not make a promise to process GWT.create() of entry point
types before any other GWT.create() calls, it was easy to restore this
behavior in incremental, so I went ahead and did it (
https://gwt-review.googlesource.com/#/c/10410/).

You should probably find a way not to depend on this in the future, as it
is not promised and may change again.


On Mon Nov 17 2014 at 2:07:02 PM Christopher Viel 
viel.christop...@gmail.com wrote:

 Hi,

 I'm gonna add some more background here.

 The generator generates a bunch of file and binds the interfaces using
 GIN. I would't say this is strictly necessary, but it brings the advantages
 of DI to the generated code. So we have an Entry Point that is an interface
 and a rebind rule. UserAgentAsserter uses a similar technique. What we also
 do is generate a Ginjector interface and put a
 *GWT.create(GeneratedGinjector.class)* call inside the generated entry
 point. That way GIN's generator is called after and everything should be
 resolvable. The generated ginjector is setup to look at a specific property
 to load additional gin modules. Here it happens  that one of them is also
 generated. So all of that actually work with 2.7.

 What no longer works is if the entry point and the ginjector are no longer
 generated. If there is a GWT.create() call that resolves to a Ginjector
 from an explicit entry point, it fails. I'm not sure I'm being very clear
 here so here's an example:

 *MyModule.gwt.xml:*
 module
 entry-point class=com.project.EntryPointToGenerate/
 entry-point class=com.project.ExplicitEntryPoint/

 extend-configuration-property name=gin.ginjector.modules
 value=com.project.GeneratedGinModule/

 generate-with class=com.project.EntryPointGenerator
 when-type-is class=com.project.EntryPointToGenerate/
 /generate-with
 /module

 *EntryPointToGenerate:*
 public interface EntryPointToGenerate extends EntryPoint {}

 *EntryPointGenerator*: Generates *com.project.GeneratedGinModule* and an
 implementation of *EntryPointToGenerate*

 *ExplicitEntryPoint*:
 public class ExplicitEntryPoint implements EntryPoint {
 private static final ExplicitGinjector GINJECTOR = GWT.create(
 ExplicitGinjector.class);

 @Override
 public void onModuleLoad() {}
 }

 *ExplicitGinjector:*
 @GinModules( value = ExplicitGinModule.class, properties =
 gin.ginjector.modules )
 public interface ExplicitGinjector extends Ginjector {
 /* snip */
 }

 With this code in a regular compilation, EntryPointToGenerate is generated
 before ExplicitEntryPoint is traversed. With incremental compilation,
 ExplicitEntryPoint is traversed (and incidentally GINs generator is called)
 before EntryPointGenerator is called. I would expect the first entry point
 to be traversed at first, even if it means calling a generator.

 On Sunday, November 16, 2014 3:56:20 PM UTC-5, Nicolas Morel wrote:

 Hi,

 I'm currently testing GWT 2.7.0-rc1 and one of my project using GWTP
 Rest-Dispatch https://github.com/ArcBees/GWTP/wiki/Rest-Dispatch is
 not working under SDM.
 The compilation fails with this error :

   [ERROR] Unable to load gin module type
 [com.gwtplatform.dispatch.rest.client.RestGinModule], maybe you haven't
 compiled your client java sources?
 java.lang.ClassNotFoundException: com$gwtplatform$dispatch$rest$
 client$RestGinModule
 at com.google.gwt.inject.rebind.GinBridgeClassLoader.findClass(
 GinBridgeClassLoader.java:150)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
 at com.google.gwt.inject.rebind.GinBridgeClassLoader.loadClass(
 GinBridgeClassLoader.java:108)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:340)
 at com.google.gwt.inject.rebind.GinjectorGenerator.loadClass(
 GinjectorGenerator.java:223)
 at com.google.gwt.inject.rebind.GinjectorGenerator.
 getPropertyModuleClasses(GinjectorGenerator.java:137)
 at com.google.gwt.inject.rebind.GinjectorGenerator.getModuleClasses(
 GinjectorGenerator.java:116)
 at com.google.gwt.inject.rebind.GinjectorGenerator.generate(
 GinjectorGenerator.java:72)
 at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(
 IncrementalGenerator.java:40)

 The full stack trace is available in attachment.

 The problem has been reported to the GWTP team here
 https://github.com/ArcBees/GWTP/issues/614. The normal compilation
 works but not the incremental compile from SDM.

 I made a simple example available here
 https://github.com/nmorel/hello-gwt-rest-dispatch.

 From what I saw, the RestGinModule that gin is trying to load is
 generated by a GWT generator (VelocityGenerator
 https://github.com/ArcBees/GWTP/blob/master/gwtp-core/gwtp-dispatch-rest/src/main/java/com/gwtplatform/dispatch/rest/rebind/VelocityGenerator.java
 .generateRestGinModule()) and passed to gin through the property
  gin.ginjector.modules.
 It seems unconventional but was working before.
 Any ideas 

[gwt-contrib] Re: SDM + gin + generated GinModule not working well together

2014-11-17 Thread confile
I can confirm that this problem occurs to me too.

Michael

Am Sonntag, 16. November 2014 21:56:20 UTC+1 schrieb Nicolas Morel:

 Hi, 

 I'm currently testing GWT 2.7.0-rc1 and one of my project using GWTP 
 Rest-Dispatch https://github.com/ArcBees/GWTP/wiki/Rest-Dispatch is not 
 working under SDM. 
 The compilation fails with this error : 

   [ERROR] Unable to load gin module type 
 [com.gwtplatform.dispatch.rest.client.RestGinModule], maybe you haven't 
 compiled your client java sources?
 java.lang.ClassNotFoundException: 
 com$gwtplatform$dispatch$rest$client$RestGinModule
 at 
 com.google.gwt.inject.rebind.GinBridgeClassLoader.findClass(GinBridgeClassLoader.java:150)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
 at 
 com.google.gwt.inject.rebind.GinBridgeClassLoader.loadClass(GinBridgeClassLoader.java:108)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:340)
 at 
 com.google.gwt.inject.rebind.GinjectorGenerator.loadClass(GinjectorGenerator.java:223)
 at 
 com.google.gwt.inject.rebind.GinjectorGenerator.getPropertyModuleClasses(GinjectorGenerator.java:137)
 at 
 com.google.gwt.inject.rebind.GinjectorGenerator.getModuleClasses(GinjectorGenerator.java:116)
 at 
 com.google.gwt.inject.rebind.GinjectorGenerator.generate(GinjectorGenerator.java:72)
 at 
 com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)

 The full stack trace is available in attachment.

 The problem has been reported to the GWTP team here 
 https://github.com/ArcBees/GWTP/issues/614. The normal compilation 
 works but not the incremental compile from SDM.

 I made a simple example available here 
 https://github.com/nmorel/hello-gwt-rest-dispatch.

 From what I saw, the RestGinModule that gin is trying to load is generated 
 by a GWT generator (VelocityGenerator 
 https://github.com/ArcBees/GWTP/blob/master/gwtp-core/gwtp-dispatch-rest/src/main/java/com/gwtplatform/dispatch/rest/rebind/VelocityGenerator.java
 .generateRestGinModule()) and passed to gin through the property
  gin.ginjector.modules. 
 It seems unconventional but was working before.
 Any ideas what is going on please ?





-- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/76a1f152-f848-4802-b3f0-4da086789cfe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[gwt-contrib] Re: SDM + gin + generated GinModule not working well together

2014-11-17 Thread Christopher Viel
Hi,

I'm gonna add some more background here.

The generator generates a bunch of file and binds the interfaces using GIN. 
I would't say this is strictly necessary, but it brings the advantages of 
DI to the generated code. So we have an Entry Point that is an interface 
and a rebind rule. UserAgentAsserter uses a similar technique. What we also 
do is generate a Ginjector interface and put a 
*GWT.create(GeneratedGinjector.class)* call inside the generated entry 
point. That way GIN's generator is called after and everything should be 
resolvable. The generated ginjector is setup to look at a specific property 
to load additional gin modules. Here it happens  that one of them is also 
generated. So all of that actually work with 2.7.

What no longer works is if the entry point and the ginjector are no longer 
generated. If there is a GWT.create() call that resolves to a Ginjector 
from an explicit entry point, it fails. I'm not sure I'm being very clear 
here so here's an example:

*MyModule.gwt.xml:*
module
entry-point class=com.project.EntryPointToGenerate/
entry-point class=com.project.ExplicitEntryPoint/

extend-configuration-property name=gin.ginjector.modules
value=com.project.GeneratedGinModule/

generate-with class=com.project.EntryPointGenerator
when-type-is class=com.project.EntryPointToGenerate/
/generate-with
/module

*EntryPointToGenerate:*
public interface EntryPointToGenerate extends EntryPoint {}

*EntryPointGenerator*: Generates *com.project.GeneratedGinModule* and an 
implementation of *EntryPointToGenerate*

*ExplicitEntryPoint*: 
public class ExplicitEntryPoint implements EntryPoint {
private static final ExplicitGinjector GINJECTOR = GWT.create(
ExplicitGinjector.class);

@Override
public void onModuleLoad() {}
}

*ExplicitGinjector:*
@GinModules( value = ExplicitGinModule.class, properties = 
gin.ginjector.modules )
public interface ExplicitGinjector extends Ginjector {
/* snip */
}

With this code in a regular compilation, EntryPointToGenerate is generated 
before ExplicitEntryPoint is traversed. With incremental compilation, 
ExplicitEntryPoint is traversed (and incidentally GINs generator is called) 
before EntryPointGenerator is called. I would expect the first entry point 
to be traversed at first, even if it means calling a generator.

On Sunday, November 16, 2014 3:56:20 PM UTC-5, Nicolas Morel wrote:

 Hi, 

 I'm currently testing GWT 2.7.0-rc1 and one of my project using GWTP 
 Rest-Dispatch https://github.com/ArcBees/GWTP/wiki/Rest-Dispatch is not 
 working under SDM. 
 The compilation fails with this error : 

   [ERROR] Unable to load gin module type 
 [com.gwtplatform.dispatch.rest.client.RestGinModule], maybe you haven't 
 compiled your client java sources?
 java.lang.ClassNotFoundException: 
 com$gwtplatform$dispatch$rest$client$RestGinModule
 at 
 com.google.gwt.inject.rebind.GinBridgeClassLoader.findClass(GinBridgeClassLoader.java:150)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
 at 
 com.google.gwt.inject.rebind.GinBridgeClassLoader.loadClass(GinBridgeClassLoader.java:108)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:340)
 at 
 com.google.gwt.inject.rebind.GinjectorGenerator.loadClass(GinjectorGenerator.java:223)
 at 
 com.google.gwt.inject.rebind.GinjectorGenerator.getPropertyModuleClasses(GinjectorGenerator.java:137)
 at 
 com.google.gwt.inject.rebind.GinjectorGenerator.getModuleClasses(GinjectorGenerator.java:116)
 at 
 com.google.gwt.inject.rebind.GinjectorGenerator.generate(GinjectorGenerator.java:72)
 at 
 com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)

 The full stack trace is available in attachment.

 The problem has been reported to the GWTP team here 
 https://github.com/ArcBees/GWTP/issues/614. The normal compilation 
 works but not the incremental compile from SDM.

 I made a simple example available here 
 https://github.com/nmorel/hello-gwt-rest-dispatch.

 From what I saw, the RestGinModule that gin is trying to load is generated 
 by a GWT generator (VelocityGenerator 
 https://github.com/ArcBees/GWTP/blob/master/gwtp-core/gwtp-dispatch-rest/src/main/java/com/gwtplatform/dispatch/rest/rebind/VelocityGenerator.java
 .generateRestGinModule()) and passed to gin through the property
  gin.ginjector.modules. 
 It seems unconventional but was working before.
 Any ideas what is going on please ?





-- 
You received this message because you are subscribed to the Google Groups GWT 
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/57be9c00-e1f2-4c99-ad20-40c0c86943aa%40googlegroups.com.
For more options,