GenDispatch in 1.2.1

72 views
Skip to first unread message

Mike

unread,
Jun 6, 2014, 8:22:32 PM6/6/14
to gwt-pl...@googlegroups.com
I am looking into migrating to 1.2.1.  I use GenDispatch to generate actions and results.  I see that GenDispatch is generating code that references com.gwtplatform.dispatch.shared.Action instead of com.gwtplatform.dispatch.rpc.shared.Action

If I attempt to move to the new *rpc* libraries, this causes a problem when using bindHandler.

Maybe what I'm seeing is the annotation processor has not been updated yet.  Then again, it wouldn't surprise me that I'm doing something wrong.  Do I have to change something in the gwt.xml file?

Olivier Lafleur

unread,
Jun 7, 2014, 10:36:53 AM6/7/14
to gwt-pl...@googlegroups.com
I'm not sure if the annotation processor has been updated, but I know that for example, if you were using 
<inherits name="com.gwtplatform.dispatch.Dispatch" />

then it should become
<inherits name="com.gwtplatform.dispatch.rpc.DispatchRpc"/>

in your .gwt.xml file.

So, you probably have some similar change to do in your .gwt. xml file.

Michael Higgins

unread,
Jun 8, 2014, 2:06:21 PM6/8/14
to gwt-pl...@googlegroups.com
Thanks for that comment.  I did make the that change in the .gwt.xml file.  I might have to dig into the annotation processor and see what is going on there.

Thanks.


--
You received this message because you are subscribed to a topic in the Google Groups "GWTP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gwt-platform/wBBJgeNdrzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gwt-platform...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christian Goudreau

unread,
Jun 8, 2014, 8:22:46 PM6/8/14
to gwt-pl...@googlegroups.com
Please dig, any help with this is welcome!


--
You received this message because you are subscribed to the Google Groups "GWTP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gwt-platform...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Christian Goudreau | CEO - Président
M: 1.877.635.1585 | S: christian.goudreau

Mike

unread,
Jun 10, 2014, 7:13:09 PM6/10/14
to gwt-pl...@googlegroups.com
You will be happy know that this was simple user error.  I had a malformed maven project definition.  The version for the gwtp-processors artifact was hard coded and incorrect.  Once I changed that, the generated class uses the correct imports.

I've encountered a different problem.  In RpcDispatchAsync.prepareExecute(A action), a call is made to prepareService((ServiceDefTarget) realService, baseUrl, action.getServiceName()).  

baseUrl is set to "dispatch/"
action.getServiceName() returns  Action.DEFAULT_SERVICE_NAME + "Login" which resolves to "dispatch/Login"  (Login is the action name)

prepareService() concats those to strings together to be "dispatch/dispatch/Login" which naturally does not work.  I get a 404 not found error.

If I force the service name in the @GenDispatch annotation to be "Login" it still fails.  If I force it to be "" the generated code goes back to Action.DEFAULT_SERVICE_NAME + "Login".

If I edit the generated code so action.getServiceName() returns "", then the action is dispatched properly.

In GWTP 1.0,
baseUrl is set to ""
action.getServiceName() returns "dispatch/"

The action get executed properly.

Looks like things are done a bit differently and perhaps I'm not setting things up correctly.  Can anyone shed some light on this?  I'll keep looking, but I might be in a bit over my head.

Mike

unread,
Jun 10, 2014, 8:38:21 PM6/10/14
to gwt-pl...@googlegroups.com
Comparing how 1.0 works to 1.2.1, in 1.0, the RpcDispatchAsync constructor is called once during ApplicationControllerImpl.init() .  At this point the ServiceEntryPoint is null.

In 1.2.1, I see also called during ApplicationControllerImpl.init() and ServiceEntryPoint is null.  I also see it called when the presenter proxy is generated at runtime either from @ProxyCodeSplit or @ProxyStandard.  ServiceEntryPoint is now set to "dispatch/".

Hmmmm.

Maxime Mériouma-Caron

unread,
Jun 16, 2014, 10:02:38 AM6/16/14
to gwt-pl...@googlegroups.com
It seems like you are missing
serve("/" + ActionImpl.DEFAULT_SERVICE_NAME + "*").with(DispatchServiceImpl.class);
 in your DispatchServletModule (server-side)

Mike

unread,
Jun 16, 2014, 2:14:20 PM6/16/14
to gwt-pl...@googlegroups.com
I had the following in my DispatchServletModule which is what I use with GWTP 1.0:

serve("/" + ActionImpl.DEFAULT_SERVICE_NAME).with(DispatchServiceImpl.class);

I added the '+ "*"' and now everything is working.

Many thanks!
Reply all
Reply to author
Forward
0 new messages