Announcement Announcement Module
Collapse
No announcement yet.
ExceptionResolver , F5 , logger. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ExceptionResolver , F5 , logger.

    Hi ,
    l have a question about exceptionResolver , F5 and logger.

    HandlerExceptionResolvers are use to handle unexpected exceptions occurring from the spring docs . Let's try make an exception occur "unexpected" , and an exception page was display , and then try to keep on pressing F5 to refresh the exception message page ( the request is using GET not POST ) , then the logger will log the error message again and agin , the logger will soon log a lot garbage error message to the log file ... sooner it will crash my system within less than a minute ... OutOfMemory ...

    l try to solve it this way,
    Code:
    <bean id="exceptionResolver" class="org.springframework.web.servlet.handler.
    SimpleMappingExceptionResolver">
         <property name="exceptionMappings">
             <props>
                 <prop key="java.lang.Exception">exception</prop>
                 <prop key="org.springframework.dao.DataAccessException">
                       redirect&#58;dataAccessException.htm
                <!-- **************************** -->
                 </prop>
             </props>
         </property>
    </bean>
    ......
    <bean id="urlMapping" class="org.springframework.web.
       servlet.handler.SimpleUrlHandlerMapping">
            <property name="mappings">
               <props>
                  <prop key="/admin/index.htm">index</prop>
                      <prop key="/admin/dataAccessException.htm">dataAccessException</prop>
                      <prop key="/admin/bookRelatedSearch.htm">bookRelatedSearch</prop>
                </props>
              </property>
    </bean>
    .......
    <bean name="dataAccessException" class="org.springframework.web
       .servlet.mvc.ParameterizableViewController">
         <property name="viewName">
              <value>dataAccessException</value>
         </property>
    </bean>
    redirect it to a new exception page to prevent the "repeated log" problem.
    but there is a problem , l cannot use it with sitemesh , because l cannot do the following ,
    Code:
    <decorators defaultdir="/decorators">
        <decorator name="BookRelatedDecor1" page="BookRelatedDecor1.jsp">
            <pattern>/admin/dataAccessException.htm</pattern>
        </decorator>
        <decorator name="BookRelatedDecor2" page="BookRelatedDecor2.jsp">
            <pattern>/admin/dataAccessException.htm</pattern>
        </decorator>
    </decorators>
    It seem that if l cannot solve these problem , and unexpected error page occur , the user can kill my system by just pressing F5 ?

    Have any one encounter this problem ?

    moon

  • #2
    Hi,

    l just crash the petclinic application with the same method - make an exception page then refresh continuously .. it load heavily , consume 100% CPU power and "dead" finally , this is serious for me , it means - when l got an exception page from the spring power applications , l can make it down any time by just pressing F5. l must be wrong again. huh~

    l do the petclinic experiment because l affriad that it is my codes problem , but after trying petclinic , it have the same behaviour as my application.
    Code:
    ..........
    ..........
    警告&#58; Handler execution resulted in exception - forwarding to resolved error view
    org.springframework.orm.ObjectRetrievalFailureException&#58; Object of class &#91;org.springframework.samples.petclinic.Owner&#93; with identifier &#91;0&#93;&#58; not found
    	at org.springframework.samples.petclinic.jdbc.AbstractJdbcClinic.loadOwner&#40;AbstractJdbcClinic.java&#58;128&#41;
    	at sun.reflect.GeneratedMethodAccessor59.invoke&#40;Unknown Source&#41;
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke&#40;Unknown Source&#41;
    	at java.lang.reflect.Method.invoke&#40;Unknown Source&#41;
    	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection&#40;AopUtils.java&#58;288&#41;
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint&#40;ReflectiveMethodInvocation.java&#58;155&#41;
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed&#40;ReflectiveMethodInvocation.java&#58;122&#41;
    	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke&#40;TransactionInterceptor.java&#58;57&#41;
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed&#40;ReflectiveMethodInvocation.java&#58;144&#41;
    	at org.springframework.samples.petclinic.jmx.CallMonitoringInterceptor.invoke&#40;CallMonitoringInterceptor.java&#58;53&#41;
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed&#40;ReflectiveMethodInvocation.java&#58;144&#41;
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke&#40;JdkDynamicAopProxy.java&#58;174&#41;
    	at $Proxy0.loadOwner&#40;Unknown Source&#41;
    	at org.springframework.samples.petclinic.web.ClinicController.ownerHandler&#40;ClinicController.java&#58;65&#41;
    	at sun.reflect.GeneratedMethodAccessor58.invoke&#40;Unknown Source&#41;
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke&#40;Unknown Source&#41;
    	at java.lang.reflect.Method.invoke&#40;Unknown Source&#41;
    	at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod&#40;MultiActionController.java&#58;351&#41;
    	at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal&#40;MultiActionController.java&#58;305&#41;
    	at org.springframework.web.servlet.mvc.AbstractController.handleRequest&#40;AbstractController.java&#58;128&#41;
    	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle&#40;SimpleControllerHandlerAdapter.java&#58;44&#41;
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch&#40;DispatcherServlet.java&#58;684&#41;
    	at org.springframework.web.servlet.DispatcherServlet.doService&#40;DispatcherServlet.java&#58;625&#41;
    	at org.springframework.web.servlet.FrameworkServlet.serviceWrapper&#40;FrameworkServlet.java&#58;386&#41;
    	at org.springframework.web.servlet.FrameworkServlet.doGet&#40;FrameworkServlet.java&#58;346&#41;
    	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;743&#41;
    	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;856&#41;
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter&#40;ApplicationFilterChain.java&#58;284&#41;
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter&#40;ApplicationFilterChain.java&#58;204&#41;
    	at org.apache.catalina.core.StandardWrapperValve.invoke&#40;StandardWrapperValve.java&#58;256&#41;
    	at org.apache.catalina.core.StandardValveContext.invokeNext&#40;StandardValveContext.java&#58;151&#41;
    	at org.apache.catalina.core.StandardPipeline.invoke&#40;StandardPipeline.java&#58;564&#41;
    	at org.apache.catalina.core.StandardContextValve.invokeInternal&#40;StandardContextValve.java&#58;245&#41;
    	at org.apache.catalina.core.StandardContextValve.invoke&#40;StandardContextValve.java&#58;199&#41;
    	at org.apache.catalina.core.StandardValveContext.invokeNext&#40;StandardValveContext.java&#58;151&#41;
    	at org.apache.catalina.core.StandardPipeline.invoke&#40;StandardPipeline.java&#58;564&#41;
    	at org.apache.catalina.core.StandardHostValve.invoke&#40;StandardHostValve.java&#58;195&#41;
    	at org.apache.catalina.core.StandardValveContext.invokeNext&#40;StandardValveContext.java&#58;151&#41;
    	at org.apache.catalina.valves.ErrorReportValve.invoke&#40;ErrorReportValve.java&#58;164&#41;
    	at org.apache.catalina.core.StandardValveContext.invokeNext&#40;StandardValveContext.java&#58;149&#41;
    	at org.apache.catalina.core.StandardPipeline.invoke&#40;StandardPipeline.java&#58;564&#41;
    	at org.apache.catalina.core.StandardEngineValve.invoke&#40;StandardEngineValve.java&#58;156&#41;
    	at org.apache.catalina.core.StandardValveContext.invokeNext&#40;StandardValveContext.java&#58;151&#41;
    	at org.apache.catalina.core.StandardPipeline.invoke&#40;StandardPipeline.java&#58;564&#41;
    	at org.apache.catalina.core.ContainerBase.invoke&#40;ContainerBase.java&#58;972&#41;
    	at org.apache.coyote.tomcat5.CoyoteAdapter.service&#40;CoyoteAdapter.java&#58;211&#41;
    	at org.apache.coyote.http11.Http11Processor.process&#40;Http11Processor.java&#58;805&#41;
    	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection&#40;Http11Protocol.java&#58;696&#41;
    	at org.apache.tomcat.util.net.TcpWorkerThread.runIt&#40;PoolTcpEndpoint.java&#58;605&#41;
    	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run&#40;ThreadPool.java&#58;677&#41;
    	at java.lang.Thread.run&#40;Unknown Source&#41;
    java.lang.OutOfMemoryError
    Can any body help me to solve it ?

    moon

    Comment

    Working...
    X