正在将应用程序从 WAS7 迁移到 Tomcat7。
我可以部署和启动 webapp。我面临的问题是 JSF 生命周期在执行操作时似乎没有完成。(不确定是否发生了这种情况,请参阅下面的解释场景)
为了监控生命周期,我编写了一个简单的生命周期代码并在faces-config.xml
LifeCycleListener.java
package com.csc.phaseEvent;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
public class LifeCycleListener implements PhaseListener {
public PhaseId getPhaseId() {
return PhaseId.ANY_PHASE;
}
public void beforePhase(PhaseEvent event) {
System.out.println("START PHASE " + event.getPhaseId());
}
public void afterPhase(PhaseEvent event) {
System.out.println("END PHASE " + event.getPhaseId());
}
}
所以这给了我在控制台StartPhase
和End Phase
每个阶段的输出,但是在END PHASE INVOKE_APPLICATION 5
参考日志之后什么都没有发生
START PHASE RESTORE_VIEW 1
END PHASE RESTORE_VIEW 1
START PHASE APPLY_REQUEST_VALUES 2
END PHASE APPLY_REQUEST_VALUES 2
START PHASE PROCESS_VALIDATIONS 3
END PHASE PROCESS_VALIDATIONS 3
START PHASE UPDATE_MODEL_VALUES 4
END PHASE UPDATE_MODEL_VALUES 4
START PHASE INVOKE_APPLICATION 5
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:29.984: ServiceDelegator : DEBUG : :Current Process Stack [[openSession.SelectRoleSuccess, coordinatorDesktop.CoordinatorDesktop, openSession.SelectRole]]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:29.985: ServiceDelegator : DEBUG : :Executing Invoke activity [SelectRole]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:29.986: ServiceDelegator : DEBUG : :invoking service action class [SET_ROLE]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:29.992: BaseServiceAction : DEBUG : :SetRole - Session Key used BAC4DB1C-ADDA-4009-4000-96BD19DEA88F/mukul
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:29.993: java.lang.Class : DEBUG : :Executing findUserSession().
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:29.994: java.lang.Class : DEBUG : mukul:Executing persistActiveRoles(UserSession inputUserSession).
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.02: ServiceDelegator : DEBUG : mukul:Current Process Stack [[openSession.SelectRoleSuccess, coordinatorDesktop.CoordinatorDesktop, openSession.SelectRoleSuccess]]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.03: ServiceDelegator : DEBUG : mukul:Executing Invoke activity [SelectRoleSuccess]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.04: ServiceDelegator : DEBUG : mukul:invoking embedded process [coordinatorDesktop]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.05: ServiceDelegator : DEBUG : mukul:Current Process Stack [[openSession.SelectRoleSuccess, coordinatorDesktop.CoordinatorDesktop, openSession.SelectRoleSuccess, coordinatorDesktop.CoordinatorDesktop]]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logXML:260) - 2013/02/15 16:38:30.06: ServiceDelegator : XML : mukul:process event final result [<process-step-result><outcome>coordinatorDesktop</outcome><result-params><has-errors><![CDATA[false]]></has-errors><error></error><PROCESS_STACK><![CDATA[openSession.SelectRoleSuccess$$coordinatorDesktop.CoordinatorDesktop$$openSession.SelectRoleSuccess$$coordinatorDesktop.CoordinatorDesktop$$]]></PROCESS_STACK><PersistElements><roleID><![CDATA[FullRep]]></roleID></PersistElements><Session><![CDATA[USK:BAC4DB1CADDA4009400096BD19DEA88F/
]]></Session><SelectRoleActionResult><![CDATA[success]]></SelectRoleActionResult><successInd><![CDATA[success]]></successInd><outcome><![CDATA[success]]></outcome></result-params></process-step-result>]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.07: XMLUtils : DEBUG : mukul:node = error NOT in XML <process-step-result><outcome>coordinatorDesktop</outcome><result-params><has-errors><![CDATA[false]]></has-errors><error></error><PROCESS_STACK><![CDATA[openSession.SelectRoleSuccess$$coordinatorDesktop.CoordinatorDesktop$$openSession.SelectRoleSuccess$$coordinatorDesktop.CoordinatorDesktop$$]]></PROCESS_STACK><PersistElements><roleID><![CDATA[FullRep]]></roleID></PersistElements><Session><![CDATA[USK:BAC4DB1CADDA4009400096BD19DEA88F/
]]></Session><SelectRoleActionResult><![CDATA[success]]></SelectRoleActionResult><successInd><![CDATA[success]]></successInd><outcome><![CDATA[success]]></outcome></result-params></process-step-result>
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.15: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [User] value [mukul]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.16: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [systems] value [[CLIENT-DB, XMLG, CyberLifeWS, Hibernate, CyberLifeWS_VSAM, AWDnative]]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.17: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [ServletURL] value [http://localhost:8080/csa/servlet/Initializer]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.17: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [currSelectionspagecode.authorization.AdminLogon] value [{}]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.18: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [currSelectionspagecode.authorization.Roles] value [{rowTable= FullRep}]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.19: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [PROCESS_STACK] value [openSession.SelectRoleSuccess$$coordinatorDesktop.CoordinatorDesktop$$openSession.SelectRoleSuccess$$coordinatorDesktop.CoordinatorDesktop$$]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.20: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [Session] value [USK%3ABAC4DB1CADDA4009400096BD19DEA88F%2F%0C%14%0A%14%0B]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.20: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [prevSelectionspagecode.authorization.AdminLogon] value [{}]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.21: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [roles] value [[Manager, FullRep, PolAdminRep, loaderRunner, Agent, CustomerService.Level1Analyst, PolOwnerService.Level1Analyst, Approver, AgentFull, OfflineUser, PolOwnerService.ReadOnly]]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.22: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [authToken] value [mukul]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.22: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [roleID] value [FullRep]
DEBUG [http-bio-8080-exec-1] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 16:38:30.23: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [prevSelectionspagecode.authorization.Roles] value [{rowTable=[ FullRep]}]
END PHASE INVOKE_APPLICATION 5
什么也没有发生,控制台上没有错误没有消息。浏览器窗口显示它正在加载,但没有加载。
这个应用程序在 WAS 上运行良好。
任何帮助将不胜感激,这种行为的可能原因是什么?
不确定还需要什么其他信息,请询问您是否需要任何信息。
更新#1
immediate = "true"
根据 maple_shaft尝试添加。
以下是堆栈跟踪
START PHASE RESTORE_VIEW 1
END PHASE RESTORE_VIEW 1
START PHASE APPLY_REQUEST_VALUES 2
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.410: ServiceDelegator : DEBUG : :Current Process Stack [[openSession.SelectRole]]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.411: ServiceDelegator : DEBUG : :Executing Invoke activity [SelectRole]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.411: ServiceDelegator : DEBUG : :invoking service action class [SET_ROLE]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.415: BaseServiceAction : DEBUG : :SetRole - Session Key used B9DB051D-8BF4-472D-4000-94BFA0965A49/mukul
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.415: java.lang.Class : DEBUG : :Executing findUserSession().
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.415: java.lang.Class : DEBUG : mukul:Executing persistActiveRoles(UserSession inputUserSession).
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.418: ServiceDelegator : DEBUG : mukul:Current Process Stack [[openSession.SelectRoleSuccess]]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.418: ServiceDelegator : DEBUG : mukul:Executing Invoke activity [SelectRoleSuccess]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.418: ServiceDelegator : DEBUG : mukul:invoking embedded process [coordinatorDesktop]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.418: ServiceDelegator : DEBUG : mukul:Current Process Stack [[openSession.SelectRoleSuccess, coordinatorDesktop.CoordinatorDesktop]]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logXML:260) - 2013/02/15 18:41:27.418: ServiceDelegator : XML : mukul:process event final result [<process-step-result><outcome>coordinatorDesktop</outcome><result-params><has-errors><![CDATA[false]]></has-errors><error></error><PROCESS_STACK><![CDATA[openSession.SelectRoleSuccess$$coordinatorDesktop.CoordinatorDesktop$$]]></PROCESS_STACK><PersistElements><roleID><![CDATA[FullRep]]></roleID></PersistElements><Session><![CDATA[USK:B9DB051D8BF4472D400094BFA0965A49/
]]></Session><SelectRoleActionResult><![CDATA[success]]></SelectRoleActionResult><successInd><![CDATA[success]]></successInd><outcome><![CDATA[success]]></outcome></result-params></process-step-result>]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.418: XMLUtils : DEBUG : mukul:node = error NOT in XML <process-step-result><outcome>coordinatorDesktop</outcome><result-params><has-errors><![CDATA[false]]></has-errors><error></error><PROCESS_STACK><![CDATA[openSession.SelectRoleSuccess$$coordinatorDesktop.CoordinatorDesktop$$]]></PROCESS_STACK><PersistElements><roleID><![CDATA[FullRep]]></roleID></PersistElements><Session><![CDATA[USK:B9DB051D8BF4472D400094BFA0965A49/
]]></Session><SelectRoleActionResult><![CDATA[success]]></SelectRoleActionResult><successInd><![CDATA[success]]></successInd><outcome><![CDATA[success]]></outcome></result-params></process-step-result>
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.420: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [systems] value [[CLIENT-DB, XMLG, CyberLifeWS, Hibernate, CyberLifeWS_VSAM, AWDnative]]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.420: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [User] value [mukul]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.420: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [ServletURL] value [http://localhost:8080/csa/servlet/Initializer]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.420: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [currSelectionspagecode.authorization.AdminLogon] value [{}]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.421: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [currSelectionspagecode.authorization.Roles] value [{rowTable= FullRep}]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.421: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [PROCESS_STACK] value [openSession.SelectRoleSuccess$$coordinatorDesktop.CoordinatorDesktop$$]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.421: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [Session] value [USK%3AB9DB051D8BF4472D400094BFA0965A49%2F%0C%14%0A%14%0B]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.421: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [roles] value [[Manager, FullRep, PolAdminRep, loaderRunner, Agent, CustomerService.Level1Analyst, PolOwnerService.Level1Analyst, Approver, AgentFull, OfflineUser, PolOwnerService.ReadOnly]]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.421: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [prevSelectionspagecode.authorization.AdminLogon] value [{}]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.421: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [authToken] value [mukul]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.421: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [prevSelectionspagecode.authorization.Roles] value [{rowTable=[ FullRep]}]
DEBUG [http-bio-8080-exec-2] (com.csc.fs.logging.Log4JHandler:logDebug:145) - 2013/02/15 18:41:27.421: pagecode.authorization.Roles : DEBUG : mukul:Persisted element [roleID] value [FullRep]
END PHASE APPLY_REQUEST_VALUES 2
更新 #2:@BalusC 建议的调试步骤
我在第 594 行放了一个断点FacesServlet#service()
,控制在这里停止。在进入它时,控制转到LifecycleImpl#render()
第 128 行。有你if
的分支,没有一个被评估为真,控制返回到FacesServlet#service()
第finally
612 行,然后调用requestEnd()
。
更新#3:
怀疑在阶段FacesContext#responseComplete()
期间被调用Invoke_Application
。这是从ExternalContextImpl#redirect()
行号 #578 调用的。while 在redirect()
子句else
中, ie ((HttpServletResponse) response).sendRedirect(requestURI);
被执行