skywalking icon indicating copy to clipboard operation
skywalking copied to clipboard

add apm-spring-annotation-plugin to dependency not work when deploy in tomcat

Open mbao opened this issue 7 years ago • 5 comments

  • Why do you submit this issue?
  • [ ] Question or discussion

Question

  • What do you want to know? In order to trace local spring span, I can put apm-spring-annotation-plugin-6.0.0-GA.jar from optional-plugins to plugins. But I wonder if I can add apm-spring-annotation-plugin to dependency for tracing spring bean? It is OK when I test this by staring my springboot application with inner tomcat, but it fails when I start my application by puting it in wabapp of tomcat 。 I wonder if this is the result of classloader of tomcat? Or can you explain it, thanks.

mbao avatar Feb 28 '19 09:02 mbao

I think it should work in Tomcat. It has no difference with other plugins. They all should work in Tomcat. No classloader issue in default Tomcat.

wu-sheng avatar Feb 28 '19 09:02 wu-sheng

I think it should work in Tomcat. It has no difference with other plugins. They all should work in Tomcat. No classloader issue in default Tomcat.

You mean put apm-spring-annotation-plugin-6.0.0-GA.jar in TOMCAT_PATH/webapps/APPLICATION/WEB-INF/lib will work as put it in AGENT_PATH/plugins ?

mbao avatar Feb 28 '19 09:02 mbao

I think it should work in Tomcat. It has no difference with other plugins. They all should work in Tomcat. No classloader issue in default Tomcat.

Put apm-spring-annotation-plugin-6.0.0-GA.jar to TOMCAT_PATH/bin works. I think AgentClassLoader's parent is AppClassLoader, and it's class path is TOMCAT_PATH/bin. Thanks for your reply.

mbao avatar Feb 28 '19 11:02 mbao

In my mind, in AGENT_PATH/plugins should work too.

wu-sheng avatar Feb 28 '19 12:02 wu-sheng

In my mind, in AGENT_PATH/plugins should work too.

Yes

mbao avatar Mar 01 '19 09:03 mbao