Skywalking: [agent]java.lang.NullPointerException: null with apm-spring-annotation-plugin-6.0.0-GA.jar

Created on 2 Mar 2019  路  6Comments  路  Source: apache/skywalking

Bug

  • Which version of SkyWalking, OS and JRE?
    SkyWalking ver: 6.0 GA
    ServiceComb ver: 1.1.0
    JRE: 1.8

when I enabled apm-spring-annotation-plugin-6.0.0-GA.jar plugins and then I get NPE !

NPE cause:

org.apache.servicecomb.core.definition.schema.AbstractSchemaFactory.setSchemaLoader 

method @Inject annotation missing , schemaLoader cannot inject.
av

disabled apm-spring-annotation-plugin-6.0.0-GA.jar

image

enabled apm-spring-annotation-plugin-6.0.0-GA.jar

image

bug

All 6 comments

@candyleer Could you take a look at this? You should have many experiences with this kind of issue. :)

OK,No problem

@vanlin can you provide a demo to reproduce this issue?

hi @candyleer, please look at this : https://github.com/vanlin/servicecombtest

I found the reason, the spring plugin remove the annotation when enhance the method, let me think and fix the issue

  cachedValue$enuaW9Jm$6e6svp1 = ProducerSchemaFactory.class.getMethod("getOrCreateProducerSchema", String.class, Class.class, Object.class);
        cachedValue$enuaW9Jm$u2pnf53 = ProducerSchemaFactory.class.getMethod("setSwaggerEnv", SwaggerEnvironment.class);
        cachedValue$enuaW9Jm$hf4k4j3 = AbstractSchemaFactory.class.getMethod("setSchemaLoader", SchemaLoader.class);

Fixed. PR merged in to master.

Was this page helpful?
0 / 5 - 0 ratings