Skip to content

springMvc项目启动不执行Controller的RequestMapping映射 #581

@panyi5202

Description

@panyi5202

Please answer these questions before submitting your issue.

What version of sky-walking are you using?

3.2.3-2017

What version of your OS?

win10

What version of your JRE?

JDK1.8.0_31

What company or project?

spring-webmvc-3.2.16

What did you do?

If possible, provide a way for reproducing the error. e.g. demo application, component version.
背景:系统中对Controller做了切面,Controller没有实现接口。

  • 当我直接启动时(未加入skywalking-agent的虚拟机参数),发现spring会生成Controller的Cglib代理对象,但是当我加入skywalking-agent的虚拟机参数启动时,spring会生成Controller的Jdk代理对象;
  • 进一步debug发现,spring之所以生成Controller的Jdk代理,是因为发现Controller有一个接口:org.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;最终在spring的RequestMappingHandlerMapping类中就无法从代理类中获取到Controller类的标注了(Controller或RequestMapping),所以就不做url的映射了。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working and you are sure it's a bug!

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions