java运行方法栈溢出

最近系统出现些奇怪的问题,抛出信息如下:

 

 

ERROR /ServiceAction/com.velcro.workflow.workflow.servlet.WfViewAction(http-0.0.0.0-38080-7) :Servlet execution threw an exception
javax.servlet.ServletException: Servlet execution threw an exception
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:313)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
 at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
 at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
 at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
 at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
 at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
 at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
 at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
 at java.lang.Thread.run(Thread.java:595)

 

Caused by: java.lang.StackOverflowError
 at java.util.regex.Pattern$BitClass.match(Pattern.java:2869)
 at java.util.regex.Pattern$Branch.match(Pattern.java:4530)
 at java.util.regex.Pattern$GroupHead.match(Pattern.java:4570)
 at java.util.regex.Pattern$Loop.match(Pattern.java:4697)
 at java.util.regex.Pattern$GroupTail.match(Pattern.java:4629)
 at java.util.regex.Pattern$BitClass.match(Pattern.java:2876)
 at java.util.regex.Pattern$Branch.match(Pattern.java:4530)
 at java.util.regex.Pattern$GroupHead.match(Pattern.java:4570)
 at java.util.regex.Pattern$Loop.match(Pattern.java:4697)
 at java.util.regex.Pattern$GroupTail.match(Pattern.java:4629)
 at java.util.regex.Pattern$BitClass.match(Pattern.java:2876)
 at java.util.regex.Pattern$Branch.match(Pattern.java:4530) 

 ……

 

很久没攻技术难点了,很是兴奋,就开始对此问题进行了解,观察下发现,有以下规律出现:

1、虽然方法栈溢出,但服务器还可以正常运行,并没有宕机。

2、目前部分时候可以出现此问题。

 

最后,试探性的考虑了下,是否觉得方法栈空间不够;所以在启动时,加大方法栈空间,参数为-Xss512k,重新启动后,问题得到解决。

不过也很奇怪通常情况下,栈空间的默认值是够用的,以后还需要对代码进行更深入的研究。

 

 

这几天,测试下来发现问题没有想象的那么简单,因为通过多次测试后发现,在增加栈空间后,还是会抛出这个错误,暂没查出原因,我将继续关注……

 

 

找出问题所在。

 

 

 

你可能感兴趣的:(java,servlet,测试,服务器)