Hi Michael,

is it also possible to use this ProxyServlet if I want to integrate my
GWT application into an external webpage?

Current status:
My server and client are running on the same server (http://localhost:
8888) and I use GWT-RPC to communicate with the server.
Now I want to integrate my gwt application into an external webpage
(for testing running on http://localhost:8080). In this external
application I therefore load the no-cache.js to load my client.
Now I have the problem that I can not do GWT-RPC calls because of the
same origin policy (different ports).

Can I use the ProxyServlet you recommended to solve this problem? Or
can you recommend me another approach to solve this problem?

Thanks in advance.


On 9 Jan., 12:42, Peter Simun <si...@seges.sk> wrote:
> Hello Michael,
>
> we are using exactly the same architecture in our most complex GWT
> project.
> Server (handling all services) is deployed in tomcat and many client
> applications are connecting to this services.
>
> You have to use a ProxyServlet because of "Same origin policy"
> restriction in GWT and define a rules for proxying.
>
> Application is accesing service using URL /super-server/service/test
> and the initialization is following:
>
> SeviceAsync service = GWT.create(Service.class);
> ServiceDefTarget endpoint = (ServiceDefTarget) service;
> endpoint.setServiceEntryPoint("/super-server/service/test");
>
> and ProxyServlet willproxythe request to the server and send back
> the response to the client.
>
> Only thing you have to do is to define a ProxySerlvet in your client
> web.xml.
>
> Please, see all details 
> here:http://code.google.com/p/acris/wiki/SeparateClientAndServer
>
> All sources are opensourced so you can use it as you want.
>
> On Jan 8, 4:56 pm, Michael Vogt <mich...@michaelvogt.eu> wrote:
>
> > Hello.
>
> > I just received a question, if it is possible to access one central
> >servlet(extending RemoteServiceServlet) that can be accessed by
> > several gwt client applications. The interface that is implemented by
> > theservletis fixed. The same interface is used by every client
> > application.
>
> > I could not find any specific information about it in the docs and on
> > this list, so I tried it out. When accessing the service, I get a null
> > pointer exception - stacktrace below. My guess is, this has something
> > to do with the rpc policy file.
>
> > What seem to work is, when we install the client apps into the same
> > war file as theservlet. The problem exists, when we try to install
> > the client applications as separate war files.
>
> > Any comments if this should work at all, and how to get it running is 
> > welcome.
>
> > We are using for this GWT 1.7.1 and Glassfish 2.1
>
> > Thanks,
> > Michael
>
> > Here is the stacktrace:
>
> > WebModule[/AppsAWC]Exception while dispatching incoming RPC call
> > java.lang.NullPointerException
> >         at
> > com.sun.enterprise.web.logger.LoggerBase.write(LoggerBase.java:215)
> >         at
> > com.sun.enterprise.web.logger.LoggerBase.log(LoggerBase.java:172)
> >         at
> > org.apache.catalina.core.ApplicationContext.log(ApplicationContext.java:839 
> > )
> >         at
> > org.apache.catalina.core.ApplicationContextFacade.log(ApplicationContextFac 
> > ade.java:323)
> >         at javax.servlet.GenericServlet.log(GenericServlet.java:335)
> >         at
> > com.google.gwt.user.server.rpc.RemoteServiceServlet.doGetSerializationPolic 
> > y(RemoteServiceServlet.java:219)
> >         at
> > com.google.gwt.user.server.rpc.RemoteServiceServlet.getSerializationPolicy( 
> > RemoteServiceServlet.java:117)
> >         at
> > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepare 
> > ToRead(ServerSerializationStreamReader.java:429)
> >         at
> > com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:234)
> >         at
> > com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServi 
> > ceServlet.java:164)
> >         at
> > com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceSer 
> > vlet.java:86)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
> >         at jorapi.awc.server.AWC.service(AWC.java:314)
> >         at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
> >         at
> > org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationF 
> > ilterChain.java:427)
> >         at
> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j 
> > ava:315)
> >         at
> > org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContex 
> > tValve.java:287)
> >         at
> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j 
> > ava:218)
> >         at
> > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:64 
> > 8)
> >         at
> > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:59 
> > 3)
> >         at
> > com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
> >         at
> > com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLoc 
> > kingStandardPipeline.java:98)
> >         at
> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:22 
> > 2)
> >         at
> > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:64 
> > 8)
> >         at
> > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:59 
> > 3)
> >         at
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
> >         at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
> >         at
> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.jav 
> > a:166)
> >         at
> > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:64 
> > 8)
> >         at
> > org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:59 
> > 3)
> >         at
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
> >         at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
> >         at
> > org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:291)
> >         at
> > com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter 
> > (DefaultProcessorTask.java:666)
> >         at
> > com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(Def 
> > aultProcessorTask.java:597)
> >         at
> > com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(Defau 
> > ltProcessorTask.java:872)
> >         at
> > com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTa 
> > sk(DefaultReadTask.java:341)
> >         at
> > com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultRead 
> > Task.java:263)
> >         at
> > com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultRead 
> > Task.java:214)
> >         at com.sun.enterprise.web.portunif.PortUnificationPipeline
> > $PUTask.doTask(PortUnificationPipeline.java:382)
> >         at
> > com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:264)
> >         at
> > com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerT 
> > hread.java:106)
-- 
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.


Reply via email to