Deletions are marked like this. | Additions are marked like this. |
Line 32: | Line 32: |
* http://stackoverflow.com/questions/1517290/problem-with-gwt-behind-a-reverse-proxy-either-nginx-or-apache |
リバースプロキシ問題
通常、gwtアプリをwarファイルとしてtomcatに配備し、apacheと連携させ、ユーザ側にはapache側にアクセスさせることと思われる。 その際、例えばgwtアプリのコンテキストパスがfoobarであるのに、apache側ではルートとしてアクセスさせるような以下のような設定を行うと、
<Location /> ProxyPass ajp://localhost:8009/foobar/ </Location>
以下のようなエラーが発生する。
Apr 5, 2012 2:37:43 PM org.apache.catalina.core.ApplicationContext log INFO: Key[type=com.gwtplatform.dispatch.server.guice.DispatchServiceImpl, annotation=[none]]: ERROR: The module path requested, /foobar/, is not in the same web application as this servlet, /foobar. Your module may not be properly configured or your client and server code maybe out of date. Apr 5, 2012 2:37:43 PM org.apache.catalina.core.ApplicationContext log INFO: Key[type=com.gwtplatform.dispatch.server.guice.DispatchServiceImpl, annotation=[none]]: WARNING: Failed to get the SerializationPolicy 'BFA4FE22E9D21F283BBB8900278EB97B' for module 'http://****/foobar/'; a legacy, 1.3.3 compatible, serialization policy will be used. You may experience SerializationExceptions as a result. Apr 5, 2012 2:37:43 PM org.apache.catalina.core.ApplicationContext log SEVERE: Key[type=com.gwtplatform.dispatch.server.guice.DispatchServiceImpl, annotation=[none]]: An IncompatibleRemoteServiceException was thrown while processing this call. com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: Type '***' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer. For security purposes, this type will not be deserialized. at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:315) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:206) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
apache側でルートコンテキストとしてアクセスさせたい場合は、tomcat側でもルートコンテキストとして配備しなければならないらしい。
答えはこのあたりにありそう