前幾天突然發現淘寶網訪問非常慢而且出錯(出現異常)猜測是淘寶網在發布新版本時出現錯誤或是某個服務器出現異常但淘寶網的工程師在輸出錯誤時生成了客戶端注釋掉的Java異常信息(包含在<!和>之間)雖然在畫面上是看不到的但查看源代碼就可以清楚的看到這個Java出錯信息
淘寶網采用阿裡巴巴自己開發的一個MVC框架動態網頁(jhtml頁面)的通用入是口WebxControllerServlet最終調用/執行模版是在TemplateModule的子類中完成的然後在Module執行完成後跳轉到一個視圖(JSP文件)在Servlet和Module中是通過Valve的職責鏈處理
圖 淘寶網部分類圖
一個Web請求的基本處理流程是
客戶端發出Web請求
WebxControllerServlet
PerformScreenTemplateValve
TemplateModule
附(本文基於下面的異常分析)
Exception: comalibabawebxWebxException: Failed to execute screen: homeMyTaobao (template:
screen/home/myTaobaovm)
at comalibabawebxWebxControllerServlethandleRequest(WebxControllerServletjava:)
at ntrollerAbstractWebxControllerServletdoGet(AbstractWebxControllerServletjava:)
at javaxservlet(HttpServletjava:)
at javaxservlet(HttpServletjava:)
at orgreApplicationFilterChaininternalDoFilter(ApplicationFilterChainjava:)
at orgreApplicationFilterChaindoFilter(ApplicationFilterChainjava:)
at comalibabawebxfilterrundataRunDataFilterdoFilter(RunDataFilterjava:)
at comalibabawebxfilterAbstractFilterdoFilter(AbstractFilterjava:)
at orgreApplicationFilterChaininternalDoFilter(ApplicationFilterChainjava:)
at orgreApplicationFilterChaindoFilter(ApplicationFilterChainjava:)
at monwebxfilterRemoteAddrFilterdoFilter(RemoteAddrFilterjava:)
at comalibabawebxfilterAbstractFilterdoFilter(AbstractFilterjava:)
at orgreApplicationFilterChaininternalDoFilter(ApplicationFilterChainjava:)
at orgreApplicationFilterChaindoFilter(ApplicationFilterChainjava:)
at comalibabawebxfiltertimerTimerFilterdoFilter(TimerFilterjava:)
at comalibabawebxfilterAbstractFilterdoFilter(AbstractFilterjava:)
at orgreApplicationFilterChaininternalDoFilter(ApplicationFilterChainjava:)
at orgreApplicationFilterChaindoFilter(ApplicationFilterChainjava:)
at orgjbosswebtomcatfiltersReplyHeaderFilterdoFilter(ReplyHeaderFilterjava:)
at orgreApplicationFilterChaininternalDoFilter(ApplicationFilterChainjava:)
at orgreApplicationFilterChaindoFilter(ApplicationFilterChainjava:)
at orgreStandardWrapperValveinvoke(StandardWrapperValvejava:)
at orgreStandardContextValveinvoke(StandardContextValvejava:)
at orgjbosswebtomcatsecuritySecurityAssociationValveinvoke(SecurityAssociationValvejava:)
at orgjbosswebtomcatsecurityJaccContextValveinvoke(JaccContextValvejava:)
at orgreStandardHostValveinvoke(StandardHostValvejava:)
at orgapachecatalinavalvesErrorReportValveinvoke(ErrorReportValvejava:)
at orgjbosswebtomcatservicejcaCachedConnectionValveinvoke(CachedConnectionValvejava:)
at orgreStandardEngineValveinvoke(StandardEngineValvejava:)
at orgnnectorCoyoteAdapterservice(CoyoteAdapterjava:)
at yoteajpAjpAprProcessorprocess(AjpAprProcessorjava:)
at yoteajpAjpAprProtocol$AjpConnectionHandlerprocess(AjpAprProtocoljava:)
at orgapAprEndpoint$Workerrun(AprEndpointjava:)
at javalangThreadrun(Threadjava:)
Caused by: comalibabaservicepipelinePipelineException: Failed to execute screen: homeMyTaobao (template:
screen/home/myTaobaovm)
at comalibabaturbinepipelinePerformScreenTemplateValveperformScreenModule
(PerformScreenTemplateValvejava:)
at comalibabaturbinepipelinePerformScreenTemplateValveinvoke(PerformScreenTemplateValvejava:)
at comalibabaturbinepipelineAbstractValveinvoke(AbstractValvejava:)
at comalibabaservicepipelineDefaultPipelineinvokeNext(DefaultPipelinejava:)
at comalibabaservicepipelineDefaultPipelineinvoke(DefaultPipelinejava:)
at comalibabaturbinepipelineChooseValve$ConditioninvokeSubPipeline(ChooseValvejava:)
at comalibabaturbinepipelineChooseValveinvoke(ChooseValvejava:)
at comalibabaturbinepipelineAbstractValveinvoke(AbstractValvejava:)
at comalibabaservicepipelineDefaultPipelineinvokeNext(DefaultPipelinejava:)
at comalibabaservicepipelineDefaultPipelineinvoke(DefaultPipelinejava:)
at comalibabaservicepipelineTryCatchFinallyValveinvokeTryPipeline(TryCatchFinallyValvejava:)
at comalibabawebxWebxControllerServlethandleRequest(WebxControllerServletjava:)
more
Caused by: comalibabawebxWebxException: [MyTaobao] Response is null or failed
at comtaobaowebmytaobaomodulescreenhomeMyTaobaoexecute(MyTaobaojava:)
at comalibabaturbinemoduleTemplateModuleexecute(TemplateModulejava:)
at comalibabaturbinepipelinePerformScreenTemplateValveperformScreenModule
(PerformScreenTemplateValvejava:)
more
From:http://tw.wingwit.com/Article/program/Java/hx/201311/25645.html