the problem appears because of the RemoteServiceRelativePath as you noticed it says relativepath, one way to fix that is to use your code ((ServiceDefTarget) gwtService).setServiceEntryPoint("/some/absolute/path"); or use the power of the relative path (that's how i do it, because I'm lazy) @RemoteServiceRelativePath("../servX") which instead of /modB/servX or /modA/servX will become /servX no matter what module calls it also you'll need to make the proper changes in web.xml so that the servlet class will be mapped to the /servX path
On Feb 21, 5:44 pm, Fabio <fabio.it...@gmail.com> wrote: > Hi, > > First, the scenario: I designed two GWT modules ("modA.gwt.xml and > modB.gwt.xml"), each with its own services: > > // Module A services > @RemoteServiceRelativePath("serv1") > public interface Service1OnModuleA extends RemoteService { ... } > > @RemoteServiceRelativePath("serv2") > public interface Service2OnModuleA extends RemoteService { ... } > > // Module B services > @RemoteServiceRelativePath("servX") > public interface ServiceXOnModuleB extends RemoteService { ... } > > @RemoteServiceRelativePath("servY") > public interface ServiceYOnModuleB extends RemoteService { ... } > > At the server side, service implementations were configured to serve / > modA/serv1, /modA/serv2, etc..., /modB/servX, /modB/servY. > > But when trying to consume Service1OnModuleA from module B code, the > call is directed to /modB/serv1, instead of /modA/serv1. Obviously, / > modB/serv1 produces a HTTP 404 error. > > By the web, I found ServiceDefTarget can be used to configure absolute > instead of relative paths: > * ((ServiceDefTarget) gwtService).setServiceEntryPoint("/some/ > absolute/path"); > > What would be the best practices in these scenarios? The topics bellow > can help to summarize the question. > * How to design and consume inter-module services? > * What's the best way to design service URLs? > * When to use and not to use RemoteServiceRelativePath annotation? > * Is there some way to define absolute paths without having to hard- > code it everywhere via ServiceDefTaget casts? > > Thanks, > Fábio. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.