本文主要是介绍skywalking监控tomcat agent大量报错日志分析,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
skywalking功能就不多说了,说多了我也不知道....
解决问题方案 1:將spring-web的版本升到4.2.X 因为path()的方法是4.2之后才有的 单独升spring-web版本不行,spring的都要升
2:保证controller的方法上
@RequestMapping(method = RequestMethod.POST, value = "") value是有定义的,没有定义value会报错
两个选一个就可以解决
下面分析解决方法,原理还没时间看 先解决问题.....
在tomcat中加入agent路径后,agent/logs下面skywalking-api.log 多了很多的错误日志,两天就把磁盘撑爆了看日志如下
DEBUG 2019-12-18 19:31:31:610 pool-1109527-thread-1 TraceSegmentServiceClient : One trace segment has been abandoned, cause by buffer is full.
DEBUG 2019-12-18 19:31:31:610 pool-1109527-thread-1 TraceSegmentServiceClient : One trace segment has been abandoned, cause by buffer is full.
DEBUG 2019-12-18 19:31:31:610 threadPoolTaskExecutor-87 TraceSegmentServiceClient : One trace segment has been abandoned, cause by buffer is full.
ERROR 2019-12-18 19:31:31:610 http-nio-8088-exec-396 InstMethodsInter : class[class com.xxxx.xxxx.controller.xxxxController] after method[xxxx] intercept failure
org.apache.skywalking.apm.plugin.spring.mvc.commons.exception.IllegalMethodStackDepthException: Please submit an new issue to Apache Skywalking if this Exception was happened.at org.apache.skywalking.apm.plugin.spring.mvc.commons.interceptor.AbstractMethodInterceptor.afterMethod(AbstractMethodInterceptor.java:150)at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:105)at com.xxxx.xxxx.controller.xxxxController.xxxx(xxxxController.java)at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:497)at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest$original$N6C0m52i(InvocableHandlerMethod.java:137)at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest$original$N6C0m52i$accessor$gsVj7jwA(InvocableHandlerMethod.java)at org.springframework.web.method.support.InvocableHandlerMethod$auxiliary$K6EC4n7Y.call(Unknown Source)at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:93)at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java)at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:777)at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:706)at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)at org.apache.catalina.core.StandardHostValve.invoke$original$d3OBIOOK(StandardHostValve.java:170)at org.apache.catalina.core.StandardHostValve.invoke$original$d3OBIOOK$accessor$XcPehfpS(StandardHostValve.java)DEBUG 2019-12-18 19:31:31:609 pool-1109527-thread-1 TraceSegmentServiceClient : One trace segment has been abandoned, cause by buffer is full.
ERROR 2019-12-18 19:31:31:609 http-nio-8088-exec-396 InstMethodsInter : class[class com.xxxx.xxxx.controller.xxxController] before method[xxxx] intercept failure
java.lang.NoSuchMethodError: org.springframework.web.bind.annotation.RequestMapping.path()[Ljava/lang/String;at org.apache.skywalking.apm.plugin.spring.mvc.commons.interceptor.RequestMappingMethodInterceptor.getRequestURL(RequestMappingMethodInterceptor.java:38)at org.apache.skywalking.apm.plugin.spring.mvc.commons.interceptor.AbstractMethodInterceptor.beforeMethod(AbstractMethodInterceptor.java:82)at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:82)at com.xxxx.xxxx.controller.xxxController.xxx(xxxController.java)at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:497)at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest$original$N6C0m52i(InvocableHandlerMethod.java:137)at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest$original$N6C0m52i$accessor$gsVj7jwA(InvocableHandlerMethod.java)at org.springframework.web.method.support.InvocableHandlerMethod$auxiliary$K6EC4n7Y.call(Unknown Source)at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:93)at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java)at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:777)at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:706)at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
重点是
查看RequestMappingMethodInterceptor源码
报错位置在这里 一个value() 一个path()
解决问题方案 1:將spring-web的版本升到4.2.X 因为path()的方法是4.2之后才有的 单独升spring-web版本不行,spring的都要升
2:保证controller的方法上
@RequestMapping(method = RequestMethod.POST, value = "") value是有定义的,没有定义value会报错
线上问题已解决,使用的方案2 value = ""
如果有误欢迎指出
这篇关于skywalking监控tomcat agent大量报错日志分析的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!