You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/04/06 07:01:19 UTC

[GitHub] [skywalking] lorgine opened a new issue #6695: java.lang.AbstractMethodError error

lorgine opened a new issue #6695:
URL: https://github.com/apache/skywalking/issues/6695


   when i want to enhance spring filter,and it happens an error like under below?
   
   `public class FilterInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
       private static final String ENHANCE_CLASS = "javax.servlet.Filter";
       private static final String INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.spring.FilterInterceptor1";
       private static final String CONSTRUCTOR_CLASS = "org.apache.skywalking.apm.plugin.spring.FilterConstructorInterceptor";
       @Override
       protected ClassMatch enhanceClass() {
           return PrefixMatch.nameStartsWith("com.ppdai.infrastructure.demo.CatServletFilter");
       }
   
       @Override
       public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
           /*return new ConstructorInterceptPoint[]{
                   new ConstructorInterceptPoint() {
                       @Override
                       public ElementMatcher<MethodDescription> getConstructorMatcher() {
                           return any();
                       }
   
                       @Override
                       public String getConstructorInterceptor() {
                           return CONSTRUCTOR_CLASS;
                       }
                   }
           };*/
           return new ConstructorInterceptPoint[0];
   
       }
   
       @Override
       public InstanceMethodsInterceptPoint[] getInstanceMethodsInterceptPoints() {
           return new InstanceMethodsInterceptPoint[]{
                   new InstanceMethodsInterceptPoint() {
                       @Override
                       public ElementMatcher<MethodDescription> getMethodsMatcher() {
                           return named("doFilter").and(takesArguments(3));
                       }
   
                       @Override
                       public String getMethodsInterceptor() {
                           return INTERCEPT_CLASS;
                       }
   
                       @Override
                       public boolean isOverrideArgs() {
                           return false;
                       }
                   }
           };
       }
   }`
   
   
   and 
   
   `public class FilterInterceptor1 implements InstanceMethodsAroundInterceptor {
   
       @Override
       public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, MethodInterceptResult result) throws Throwable {
   
       }
   
       @Override
       public Object afterMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Object ret) throws Throwable {
           return ret;
       }
   
       @Override
       public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Throwable t) {
   
       }
   }`
   
   
   `
   @WebFilter
   public class CatServletFilter  implements Filter {
       @Override
       public void init(FilterConfig filterConfig) throws ServletException {
   
       }
   
       @Override
       public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
           chain.doFilter(request,response);
       }
   
       @Override
       public void destroy() {
   
       }
   }
   `


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng closed issue #6695: java.lang.AbstractMethodError error

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #6695:
URL: https://github.com/apache/skywalking/issues/6695


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking] wu-sheng commented on issue #6695: java.lang.AbstractMethodError error

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6695:
URL: https://github.com/apache/skywalking/issues/6695#issuecomment-813879035


   Your description is chaotic, please make it well-formatted. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org