Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpringMVC plugin not support servlet-api-2.5 #2975

Closed
1 of 4 tasks
ghost opened this issue Jul 1, 2019 · 6 comments
Closed
1 of 4 tasks

SpringMVC plugin not support servlet-api-2.5 #2975

ghost opened this issue Jul 1, 2019 · 6 comments
Assignees
Labels
agent Language agent related. feature New feature plugin Plugin for agent or collector. Be used to extend the capabilities of default implementor.
Milestone

Comments

@ghost
Copy link

ghost commented Jul 1, 2019

Please answer these questions before submitting your issue.

  • Why do you submit this issue?
  • Question or discussion
  • Bug
  • Requirement
  • Feature or performance improvement

Bug

  • SkyWalking 6.1.0

  • OS CentOS

  • JRE 1.8

  • What happen?
    A springMVC webapp project is running with a Web Container. In my case, it is running with Weblogic11g which is implemented based on servlet-api-2.5. I had review the source code of springmvc plugin and found out it is implemented based on servlet-api-3.0.1.
    Therefore, when org.apache.skywalking.apm.plugin.spring.mvc.commons.interceptor.AbstractMethodInterceptor.afterMethod calls HttpServletResponse.getStatus(), it will throw NoSuchMethodException.

@wu-sheng wu-sheng added agent Language agent related. feature New feature plugin Plugin for agent or collector. Be used to extend the capabilities of default implementor. labels Jul 1, 2019
@wu-sheng
Copy link
Member

wu-sheng commented Jul 1, 2019

I think we need a witness class to set two interceptors for different servlet-api versions.

@candyleer
Copy link
Member

A simple way is to add a judgement for HttpServletResponse. getStatus if it is exists ,I can solve this.

@candyleer candyleer self-assigned this Jul 15, 2019
@wu-sheng wu-sheng added this to the 6.3.0 milestone Jul 16, 2019
@wu-sheng
Copy link
Member

A simple way is to add a judgement for HttpServletResponse. getStatus if it is exists ,I can solve this.

What kind of judgement? Doing a refactor checker?

@candyleer
Copy link
Member

candyleer commented Jul 17, 2019

I mean just add a if,such as
image
cause for servlet below version 3 just not have getStatus method which we used ,this method will effect springMvc,tomcat,jetty.

So in servlet2.5,we just ignore the status judge .

@wu-sheng
Copy link
Member

OK, that is a tricky thing to JVM, using a fast fail to acoid the issue. I guess it should work.

Please test it, if pass as expected, submit the PR.

@wu-sheng
Copy link
Member

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent Language agent related. feature New feature plugin Plugin for agent or collector. Be used to extend the capabilities of default implementor.
Projects
None yet
Development

No branches or pull requests

4 participants