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
Spring Boot application with security filter startup fails with 5.0 beta agent #1361
Comments
Could you provide a demo application to reproduce the DI failure. @ascrutae maybe this is springboot 2.0 related? |
Not related to SB2 as I am having the same trouble with SB 1.5. The problem lies somewhere in our Spring Security initialization. The web auth module that does JWT auth is failing to initialize when I include the java agent. Will have to see if I can reproduce this in an example as the application code and security is not shareable. |
I can provide this detail to help you guess what is really happening. Each controller in your application will be added a new field for auto instrumentation, your log has mentioned it. So maybe your applucation security component will check the fields somehow. This is the potential cause. Of source, skywalking wouldn't add any autoware annotation for that field, that should be normal harmness field. But in your case, it harms. If you can pinpoint whats codes in your or spring in checking this, and how to check. We can provide more helps. |
The above information helps. Let me dig in a little bit on this and then get back on this thread. In the meantime, would like to know if skywalking can be configured to ignore some of these troublesome classes. For instance in this case the security library is developed by a third party. The application simply includes it in our dependency and plugs the custom JWT authentication. |
In our spring security implementation one of the bean post processor does the following to register the auth controller. Now the auth controller is being created with dependencyCheck = true which causes spring to run a dependency check on all properties (objects and primitives). One of the property being "skyWalkingDynamicField" is found to be unset and gets caught. @OverRide I don't see a way to change this common code. Any chance we can configure skywalking to ignore classes for injection. |
Do you use a pattern match in SpringMVC? Such as url= If you are using, we have to change the source codes of SpringMVC, not too hard, but still to change and recompile at your local. |
@gamefundas I had been reproduce this issue. I will try to find the cause about this issue. |
@gamefundas I had fix this issue in PR #1375 |
@gamefundas I think at least #1375 is a conflict with Spring Framework. You could try this by compiling master branch. But be advised, don't try to use collector and UI, there are some incompatible issues for preparing the beta2 release. |
Please answer these questions before submitting your issue.
Bug
Which version of SkyWalking, OS and JRE?
Skywalking 5.0 Beta, Amazon Linux, JRE 1.8, Spring Boot 2.0
Which company or project?
Personal research on APM tools
What happen?
If possible, provide a way for reproducing the error. e.g. demo application, component version.
When the Skywalking java agent is used in my Spring boot 2.0 application I am getting the following error
2018-06-16 17:07:12,956 ERROR ip-10-83-72-93 [main] org.springframework.boot.SpringApplication - Application run failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webAuthController': Unsatisfied dependency expressed through bean property 'skyWalkingDynamicField': Set this property value or disable dependency checking for this bean. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.checkDependencies(AbstractAutowireCapableBeanFactory.java:1548) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1352) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:388) at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1234) at com.myapp.Application.main(Application.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:58)
Requirement or improvement
I am trying to get Skywalking agent up and running for my spring boot application and currently the collector and ui is all set to receive data. However my application startup fails because of the agent library interfering with Spring DI
The text was updated successfully, but these errors were encountered: