You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/03/05 13:36:20 UTC
[GitHub] [incubator-skywalking] candyleer opened a new pull request #2319:
Fix Spring Annotation Plugin (Also Inherit Issue)
candyleer opened a new pull request #2319: Fix Spring Annotation Plugin (Also Inherit Issue)
URL: https://github.com/apache/incubator-skywalking/pull/2319
Please answer these questions before submitting pull request
- Why submit this pull request?
- [x] Bug fix
- [ ] New feature provided
- [ ] Improve performance
- Related issues
#2308
___
### Bug fix
- Bug description.
servicecombe NPE when use spring-annotation-plugin.
- How to fix?
use `DeclaredInstanceMethodsInterceptPoint ` instead of `InstanceMethodsInterceptPoint ` to prevent enhance parent method. (servicecombe framework has many spring annotation and hierarchy relations)
after fixed,enhanced methods are below which not contain the `setSchemaLoader `,that as our expected.
```
static {
ClassLoader.getSystemClassLoader().loadClass("org.apache.skywalking.apm.dependencies.net.bytebuddy.dynamic.Nexus").getMethod("initialize", Class.class, Integer.TYPE).invoke((Object)null, ProducerSchemaFactory.class, 831121445);
cachedValue$YscvAqFk$6e6svp1 = ProducerSchemaFactory.class.getMethod("getOrCreateProducerSchema", String.class, Class.class, Object.class);
cachedValue$YscvAqFk$u2pnf53 = ProducerSchemaFactory.class.getMethod("setSwaggerEnv", SwaggerEnvironment.class);
LOGGER = LoggerFactory.getLogger(ProducerSchemaFactory.class);
}
```
original code are below in parent class:
```java
@Inject
public void setSchemaLoader(SchemaLoader schemaLoader) {
this.schemaLoader = schemaLoader;
}
```
If child class enchance parent class method, the annotation will be ignored that make the functional error
___
### New feature or improvement
- Describe the details and related test reports.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services