opentracing-contrib / java-specialagent

Automatic instrumentation for 3rd-party libraries in Java applications with OpenTracing.
Apache License 2.0
185 stars 46 forks source link

Special agent crashes with application which has spring-webflux as a dependency and throws "missing ServletWebServerFactory bean" #605

Open rajivgudipati opened 3 years ago

rajivgudipati commented 3 years ago

Hi Team, I just downloaded a sample app from spring starter io with spring-boot-starter-webflux as a dependency. When I attach special agent and try to instrument. App crashes while starting the application server with below error. Dependency:

org.springframework.boot spring-boot-starter-webflux

Error: _main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.

Application runs fine without agent. I tried to debug a lot but could not find right solution. When I add below dependency special agent works fine.

org.springframework.boot spring-boot-starter-web

But my question is, why spring web-flux project requires spring mvc. We cannot demand applicaiton team to include additional dependency right. Agent should able to instrument the code without any changes in app source.

Your help is greatly appreciated.

Regards, Rajiv