Hi all, has anyone had any problems doing remote testing in manual
mode?

I figured out how to get my eclipse-generated test run configuration
to run in manual mode by putting...

-Dgwt.args="-runStyle Manual:1"

...into the VM args box of the run configuration, and when I try to
run the tests from a browser on the localhost, I have no problem, but
when I try to run the test from a remote host, I get the following in
my console...

[WARN] StandardContext[]Exception while dispatching incoming RPC call
java.lang.SecurityException: Blocked hosted mode request
        at com.google.gwt.rpc.server.RpcServlet.getClientOracle
(RpcServlet.java:94)
        at com.google.gwt.user.server.rpc.HybridServiceServlet.getClientOracle
(HybridServiceServlet.java:63)
        at com.google.gwt.rpc.server.RpcServlet.processPost(RpcServlet.java:
177)
        at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost
(AbstractRemoteServiceServlet.java:62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at com.google.gwt.junit.server.JUnitHostImpl.service
(JUnitHostImpl.java:131)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at com.google.gwt.dev.shell.GWTShellServlet.service
(GWTShellServlet.java:288)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:237)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:157)
        at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:214)
        at org.apache.catalina.core.StandardValveContext.invokeNext
(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardContextValve.invokeInternal
(StandardContextValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:152)
        at org.apache.catalina.core.StandardValveContext.invokeNext
(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:137)
        at org.apache.catalina.core.StandardValveContext.invokeNext
(StandardValveContext.java:104)
        at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:118)
        at org.apache.catalina.core.StandardValveContext.invokeNext
(StandardValveContext.java:102)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:109)
        at org.apache.catalina.core.StandardValveContext.invokeNext
(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke
(StandardPipeline.java:520)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:
929)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:
160)
        at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:799)
        at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt
(PoolTcpEndpoint.java:577)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(ThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:619)

I actually get the same problem if I run the tests from a browser on
the local machine but use the machines actual address instead of
127.0.1.1.

When I looked at RpcServlet.java:94 [1] I found...

        if (!allowHostedModeConnections()) {
          throw new SecurityException("Blocked hosted mode request");
        }

... and a bit further down ...

  /**
   * Indicates whether or not an RPC request from a hosted mode client
should be
   * serviced. Requests from hosted mode clients will expose
unobfuscated
   * identifiers in the payload. It is intended that developers
override this
   * method to restrict access based on installation-specific logic
(such as a
   * range of IP addresses, checking for certain cookies, etc.)
   * <p>
   * The default implementation allows hosted-mode connections from
the local
   * host, loopback addresses (127.*), site local (RFC 1918), link
local
   * (169.254/16) addresses, and their IPv6 equivalents.
   *
   * @return <code>true</code> if a hosted mode connection should be
allowed
   * @see #getThreadLocalRequest()
   * @see InetAddress
   */
  protected boolean allowHostedModeConnections() {
    return isRequestFromLocalAddress();
  }

... which suggests that you cannot run the tests from a remote client.

However, the docs [2,3] say you *can* use manual mode for remote
testing.

Am I missing something?

Any help greatly appreciated,

Alistair

[1] 
http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/rpc/server/RpcServlet.java?spec=svn5753&r=57
[2] 
http://code.google.com/webtoolkit/doc/latest/DevGuideTesting.html#Manual_Mode
[3] 
http://code.google.com/webtoolkit/doc/latest/DevGuideTestingRemoteTesting.html#Manual
-- 
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