<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=hanswesterbeek" rel="nofollow">Hans Westerbeek</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-4335?redirect=false" rel="nofollow">SPR-4335</a></strong> and commented</p>
<p dir="auto">This issue is identical to: <a href="http://jira.springframework.org/browse/SPR-4235" rel="nofollow">http://jira.springframework.org/browse/SPR-4235</a> except the fix has not been propagated to portlet-mvc.</p>
<p dir="auto">The problem finally affects the user by making it impossible to let SimpleMappingingExceptionResolver map the configurated error view. Instead it falls back to the default error view.</p>
<p dir="auto">Stacktrace:</p>
<p dir="auto">2008-01-15 10:18:24,646 WARN [org.springframework.web.portlet.DispatcherPortlet] - &lt;Handler execution resulted in exception - forwarding to resolved error view&gt;<br>
java.lang.IllegalStateException: Unexpected exception thrown<br>
at org.springframework.util.ReflectionUtils.handleUnexpectedException(ReflectionUtils.java:290)<br>
at org.springframework.util.ReflectionUtils.rethrowRuntimeException(ReflectionUtils.java:260)<br>
at org.springframework.util.ReflectionUtils.handleInvocationTargetException(ReflectionUtils.java:239)<br>
at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.doHandle(AnnotationMethodHandlerAdapter.java:233)<br>
at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.handleAction(AnnotationMethodHandlerAdapter.java:148)<br>
at org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:694)<br>
at org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:484)<br>
at org.springframework.web.portlet.FrameworkPortlet.processAction(FrameworkPortlet.java:466)<br>
at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:218)<br>
at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:139)<br>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)<br>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)<br>
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)<br>
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br>
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)<br>
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)<br>
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)<br>
at org.apache.pluto.core.DefaultPortletInvokerService.invoke(DefaultPortletInvokerService.java:167)<br>
at org.apache.pluto.core.DefaultPortletInvokerService.action(DefaultPortletInvokerService.java:85)<br>
at org.apache.pluto.core.PortletContainerImpl.doAction(PortletContainerImpl.java:219)<br>
at org.apache.pluto.driver.PortalDriverServlet.doGet(PortalDriverServlet.java:112)<br>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)<br>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)<br>
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)<br>
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br>
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)<br>
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)<br>
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)<br>
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)<br>
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)<br>
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:419)<br>
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)<br>
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)<br>
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)<br>
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)<br>
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)<br>
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)<br>
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)<br>
at java.lang.Thread.run(Thread.java:619)<br>
Caused by: nl.neteffect.dtg.datafabriek.service.NoMoreContactsLeftException<br>
at nl.neteffect.dtg.datafabriek.service.CustomerServiceImpl.popContact(CustomerServiceImpl.java:199)<br>
at sun.reflect.GeneratedMethodAccessor248.invoke(Unknown Source)<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
at java.lang.reflect.Method.invoke(Method.java:597)<br>
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)<br>
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)<br>
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)<br>
at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:70)<br>
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)<br>
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)<br>
at $Proxy18.popContact(Unknown Source)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
at java.lang.reflect.Method.invoke(Method.java:597)<br>
at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:205)<br>
at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38)<br>
at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78)<br>
at org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:114)<br>
at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:74)<br>
at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)<br>
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)<br>
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)<br>
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)<br>
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)<br>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)<br>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)<br>
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)<br>
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)<br>
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)<br>
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)<br>
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)<br>
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)<br>
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)<br>
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)<br>
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)<br>
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)<br>
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)<br>
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)<br>
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)<br>
at java.lang.Thread.run(Thread.java:619)<br>
at org.springframework.remoting.support.RemoteInvocationUtils.fillInClientStackTraceIfPossible(RemoteInvocationUtils.java:47)<br>
at org.springframework.remoting.support.RemoteInvocationResult.recreate(RemoteInvocationResult.java:115)<br>
at org.springframework.remoting.support.RemoteInvocationBasedAccessor.recreateRemoteInvocationResult(RemoteInvocationBasedAccessor.java:85)<br>
at org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.invoke(HttpInvokerClientInterceptor.java:163)<br>
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)<br>
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)<br>
at $Proxy4.popContact(Unknown Source)<br>
at nl.neteffect.dtg.promopages.backend.controller.DataEntryController.selectContact(DataEntryController.java:115)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
at java.lang.reflect.Method.invoke(Method.java:597)<br>
at org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter.doHandle(AnnotationMethodHandlerAdapter.java:230)<br>
... 35 more</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.1</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398083721" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/8913" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/8913/hovercard" href="https://github.com/spring-projects/spring-framework/issues/8913">#8913</a> [AnnotationMethodHandlerAdapter] Improve handling of InvocationTargetExceptions (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=jtuchscherer" rel="nofollow">Johannes Tuchscherer</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-8319?redirect=false" rel="nofollow">SPR-8319</a></strong> and commented</p>
<p dir="auto">When there are a lot of requests hitting a request method with parameter annotations we occasionally get a deadlock in the jvm (see below for stack trace). I think this could be easily fixed in the org.springframework.core.HandlerMethodInvoker, if - instead of creating a new instance of MethodParameter every time (line 243) - the methodParameters and their annotations would be cached. This would also give us a nice performance gain, since we don't need to lookup annotations every time the request method is called.</p>
<p dir="auto">java.lang.Thread.State: BLOCKED (on object monitor)<br>
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:417)  - waiting to lock &lt;0x00000000ac1166d0&gt; (a java.util.HashMap)<br>
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)<br>
at sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:239)<br>
at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:229)<br>
at sun.reflect.annotation.AnnotationParser.parseParameterAnnotations2(AnnotationParser.java:133)<br>
at sun.reflect.annotation.AnnotationParser.parseParameterAnnotations(AnnotationParser.java:110)<br>
at java.lang.reflect.Method.getParameterAnnotations(Method.java:751)<br>
at org.springframework.core.MethodParameter.getParameterAnnotations(MethodParameter.java:232)<br>
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(HandlerMethodInvoker.java:246)<br>
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:169)<br>
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:421)<br>
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:409)<br>
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)<br>
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)<br>
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)<br>
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)<br>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)</p>
<p dir="auto">Blocked by:</p>
<p dir="auto">java.lang.Thread.State: BLOCKED (on object monitor)<br>
at java.util.AbstractList.iterator(AbstractList.java:273)<br>
at java.util.AbstractList.hashCode(AbstractList.java:524)<br>
at java.util.HashMap.get(HashMap.java:300)<br>
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:426)  - locked &lt;0x00000000ac1166d0&gt; (a java.util.HashMap)<br>
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)<br>
at sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:239)<br>
at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:229)<br>
at sun.reflect.annotation.AnnotationParser.parseParameterAnnotations2(AnnotationParser.java:133)<br>
at sun.reflect.annotation.AnnotationParser.parseParameterAnnotations(AnnotationParser.java:110)<br>
at java.lang.reflect.Method.getParameterAnnotations(Method.java:751)<br>
at org.springframework.core.MethodParameter.getParameterAnnotations(MethodParameter.java:232)<br>
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(HandlerMethodInvoker.java:246)<br>
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:169)<br>
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:421)<br>
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:409)<br>
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)<br>
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)<br>
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)<br>
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)<br>
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.2</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398118478" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/13936" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/13936/hovercard" href="https://github.com/spring-projects/spring-framework/issues/13936">#13936</a> monitor contention at org.springframework.core.MethodParameter.getParameterAnnotations() (<em><strong>"duplicates"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398153280" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14429" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14429/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14429">#14429</a> Develop ConcurrentReferenceHashMap</li>
</ul>
<p dir="auto">1 votes, 2 watchers</p>