Re: one servlet, many clients with gwt-rpc

2010-01-20 Thread Peter Simun
Hello shed,

yes, you can use ProxyServlet, but you have to deploy ProxyServlet
(acris-external) also with your external application.
So your proxyservlet will handle each request in your external
appication and in case of specific request url (for example
http://localhost:8080/app/service) ProxyServlet will proxy your
request to the correct tomcat (http://localhost:/service).

This all parameters are configurable using regular expressions, so you
can configure your specific URL for accessing services (http://
localhost:8080/app/service) and also target URL of real server (http://
localhost:/service).

Peter

On 14. Jan, 13:39 h., shed cornelia.unterzauc...@gmail.com wrote:
 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:
 ) 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 onhttp://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
   

Re: one servlet, many clients with gwt-rpc

2010-01-14 Thread shed
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:
) 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
  

Re: one servlet, many clients with gwt-rpc

2010-01-11 Thread Peter Simun
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 will proxy the 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
 the servlet is 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 the servlet. 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
 

one servlet, many clients with gwt-rpc

2010-01-08 Thread Michael Vogt
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
the servlet is 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 the servlet. 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(ApplicationContextFacade.java:323)
at javax.servlet.GenericServlet.log(GenericServlet.java:335)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doGetSerializationPolicy(RemoteServiceServlet.java:219)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.getSerializationPolicy(RemoteServiceServlet.java:117)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepareToRead(ServerSerializationStreamReader.java:429)
at
com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:234)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:164)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.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(ApplicationFilterChain.java:427)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at
com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
at
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
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.java:166)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
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(DefaultProcessorTask.java:597)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:872)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.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(SSLWorkerThread.java:106)
-- 
You received this message because you are