0

Spring 3.1.2 を使用する appengine アプリケーションがあり、問題なく動作しています。Resident/Dynamic インスタンスは、ウォームアップを使用して正常に起動します。

2013-05-20 20:32:53.786 /_ah/warmup 200 27205ms 0kb

現在、「バックエンド」インスタンスによって処理されるようにタスク キューを構成しようとしていますが、/_ah/start の実行中に、次の予期しない HTTP 302 リダイレクト ステータス コードがログに記録されます。

2013-05-20 20:43:57.345 /_ah/start 302 50631ms 0kb instance=0

0.1.0.3 - - [20/May/2013:16:43:56 -0700] "GET /_ah/start HTTP/1.1" 302 106 - - "0.my-backend.my-application.appspot.com" ms=50597 cpu_ms=44134 cpm_usd=0.000012 loading_request=1 exit_code=111 instance=0 app_engine_release=1.8.0

I 2013-05-20 20:43:09.864 javax.servlet.ServletContext log: Initializing Spring root WebApplicationContext

...
A bunch of messages...
...

I 2013-05-20 20:43:55.659 org.springframework.web.context.ContextLoader initWebApplicationContext: Root WebApplicationContext: initialization completed in 45793 ms
I 2013-05-20 20:43:56.442 This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.
E 2013-05-20 20:43:56.442 Process terminated because it failed to respond to the start request with an HTTP status code of 200-299 or 404.

web.xml で Spring Servlet と Filter Chain を削除しましたが、何も変わりませんでした。

また、_ah を unsecured としてマップしました。常駐インスタンスでは期待どおりに機能しますが、バックエンドでは機能しません:

<http security="none" pattern="/_ah/**" disable-url-rewriting="true"/>

何か不足していますか?!?!

4

1 に答える 1

0

私は解決策を見つけました...それはSpring View Resolverとの競合であり、「_ah/start」をプレフィックスとサフィックスでリダイレクトしようとしていました:

<bean lazy-init="true"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  <property name="prefix" value="/WEB-INF/views/" />
  <property name="suffix" value=".jsp" />
</bean>

それを解決するために、「ウォームアップ」と「開始」を空のサーブレットにマップしました。

<servlet>
  <servlet-name>_ah_warmup</servlet-name>
  <servlet-class>com.my.app.EmptyWarmupServlet</servlet-class>
</servlet>

<servlet-mapping>
  <servlet-name>_ah_warmup</servlet-name>
  <url-pattern>/_ah/warmup</url-pattern>
  <url-pattern>/_ah/start</url-pattern>
</servlet-mapping>

これで、バックエンドが開始され、タスク キューが期待どおりに処理されます !!

于 2013-05-21T12:08:23.423 に答える