15:11:14,676 WARN FacesRequestAttributes:121 - FacesRequestAttributes がそのようなコールバックをサポートしていないため、属性 'purchaseController' の破棄コールバック [org.springframework.beans.factory.support.DisposableBeanAdapter@1059fd6] を登録できませんでした
この警告メッセージは私のログによく出てきます。有効期限が切れるたびに、すべてのマネージド Bean に対して。MyFaces Orchestra を使用しているため、一定時間後に有効期限が切れます。
で定義しorg.springframework.web.context.request.RequestContextListener
ましたweb.xml
が、クラスパスにSpring jarのみがありません(つまり、クラスロードの問題ではありません)
FacesRequestAttribute のドキュメントには次のように書かれています。
注: ServletRequestAttributes とは対照的に、このバリアントは、リクエスト スコープでもセッション スコープでも、スコープ属性の破棄コールバックをサポートしていません。このような暗黙の破棄コールバックに依存している場合は、web.xml で Spring RequestContextListener を定義することを検討してください。
はpurchaseController
、実際には単純なマネージド Bean (何も拡張せず、実装のみSerializable
) であり、 で注釈が付けられてい@Controller
ます。
アップデート1:
中の豆が影響を受けているようです@Scope("request")
。@Scope("session")
したがって、この警告が適切なフローに危険をもたらすかどうかを知りたかったのです。つまり、これらのコールバックが本当に必要な場合です。そうでない場合は、lo4j 構成で警告をスキップします。
更新 2:
もう少し掘り下げたところ、これは時々しか起こらないようです. リスナーが使用されている場合、 ではなくをRequestContextHolder.currentRequestAttributes()
返します。そのため、リスナーが機能せず、現在の属性が に設定されないことがあるようです。ServletRequestAttributes
FacesRequestAttributes
RequestContextHolder
更新 3:
のデバッグをオンにしましRequestContextListener
た。結果は次のとおりです。
07:21:31,518 DEBUG RequestContextListener:69 - Bound request context to thread: org.apache.catalina.connector.RequestFacade@1190ae9
07:21:31,518 DEBUG RequestContextListener:89 - Cleared thread-bound request context: org.apache.catalina.connector.RequestFacade@1190ae9
07:21:31,538 WARN FacesRequestAttributes:121 - Could not register destruction callback [org.springframework.beans.factory.support.DisposableBeanAdapter@11aa152] for attribute 'org.apache.myfaces.orchestra.conversation.AccessScopeManager' because FacesRequestAttributes does not support such callbacks
07:21:31,541 WARN FacesRequestAttributes:121 - Could not register destruction callback [org.springframework.beans.factory.support.DisposableBeanAdapter@1552393] for attribute 'localeController' because FacesRequestAttributes does not support such callbacks
....and so on, other request and session beans
Bean へのアクセスが試行される前に、リクエストが破棄されたようです。これは非常に奇妙です。これは、リスナー処理のサーブレット コンテナの実装に問題がある可能性がありますか?