candyleer commented on issue #1256: Fix occure the NPE when SpringMVC and 
hystrix work together
URL: 
https://github.com/apache/incubator-skywalking/pull/1256#issuecomment-391396003
 
 
   @ascrutae I have tested in my case,but it also has NPE
   
   this method will be invoked twice ,and sencond one will throw NPE,
   1.works good
   
![image](https://user-images.githubusercontent.com/11530760/40435291-efeab4ae-5ee2-11e8-8330-1e5265e736e1.png)
   2.NPE
   
![image](https://user-images.githubusercontent.com/11530760/40435330-047d6cfe-5ee3-11e8-9c6e-f5b45ea8cf0f.png)
   `(NativeWebRequest)objInst.getSkyWalkingDynamicField()` is null
   
   and they are in the same thread
   
   NPE
   ```
   ERROR 2018-05-23 23:40:18 InstMethodsInter :  class[class 
org.springframework.web.method.HandlerMethod] after method[getBean] intercept 
failure
   java.lang.NullPointerException
        at 
org.apache.skywalking.apm.plugin.spring.mvc.commons.interceptor.GetBeanInterceptor.afterMethod(GetBeanInterceptor.java:51)
        at 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:105)
        at 
org.springframework.web.method.HandlerMethod.getBean(HandlerMethod.java)
        at 
org.springframework.web.servlet.handler.AbstractHandlerMethodExceptionResolver.shouldApplyTo(AbstractHandlerMethodExceptionResolver.java:47)
        at 
org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver.resolveException(AbstractHandlerExceptionResolver.java:131)
        at 
org.springframework.web.servlet.handler.HandlerExceptionResolverComposite.resolveException(HandlerExceptionResolverComposite.java:76)
        at 
org.springframework.web.servlet.DispatcherServlet.processHandlerException(DispatcherServlet.java:1222)
        at 
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1034)
        at 
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:984)
        at 
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
        at 
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
        at 
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
        at 
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at com.example.test.CustomFilter.doFilter(CustomFilter.java:37)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to