error

Caused by: java.lang.NullPointerException: null
    at com.mangofactory.swagger.models.property.field.FieldModelPropertyProvider.propertiesForSerialization(FieldModelPropertyProvider.java:54) ~[swagger-models-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.models.property.provider.DefaultModelPropertiesProvider.propertiesForSerialization(DefaultModelPropertiesProvider.java:34) ~[swagger-models-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.models.ModelDependencyProvider.propertiesFor(ModelDependencyProvider.java:119) ~[swagger-models-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.models.ModelDependencyProvider.resolvedPropertiesAndFields(ModelDependencyProvider.java:94) ~[swagger-models-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.models.ModelDependencyProvider.resolvedDependencies(ModelDependencyProvider.java:75) ~[swagger-models-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.models.ModelDependencyProvider.resolvedTypeParameters(ModelDependencyProvider.java:83) ~[swagger-models-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.models.ModelDependencyProvider.resolvedDependencies(ModelDependencyProvider.java:74) ~[swagger-models-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.models.ModelDependencyProvider.dependentModels(ModelDependencyProvider.java:37) ~[swagger-models-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.models.DefaultModelProvider.dependencies(DefaultModelProvider.java:82) ~[swagger-models-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.readers.ApiModelReader.populateDependencies(ApiModelReader.java:215) ~[swagger-springmvc-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.readers.ApiModelReader.execute(ApiModelReader.java:80) ~[swagger-springmvc-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.readers.ApiModelReader.execute(ApiModelReader.java:39) ~[swagger-springmvc-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.core.CommandExecutor.execute(CommandExecutor.java:13) ~[swagger-springmvc-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.scanners.ApiListingScanner.scan(ApiListingScanner.java:100) ~[swagger-springmvc-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.core.SwaggerApiResourceListing.initialize(SwaggerApiResourceListing.java:72) ~[swagger-springmvc-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.plugin.SwaggerSpringMvcPlugin.initialize(SwaggerSpringMvcPlugin.java:427) ~[swagger-springmvc-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.plugin.SwaggerPluginAdapter.onApplicationEvent(SwaggerPluginAdapter.java:51) ~[swagger-springmvc-1.0.2.jar:1.0.2]
    at com.mangofactory.swagger.plugin.SwaggerPluginAdapter.onApplicationEvent(SwaggerPluginAdapter.java:21) ~[swagger-springmvc-1.0.2.jar:1.0.2]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:380) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:386) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:854) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:540) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.cloud.netflix.feign.FeignClientFactory.createContext(FeignClientFactory.java:108) ~[spring-cloud-netflix-core-1.1.0.M2.jar:1.1.0.M2]
    at org.springframework.cloud.netflix.feign.FeignClientFactory.getContext(FeignClientFactory.java:75) ~[spring-cloud-netflix-core-1.1.0.M2.jar:1.1.0.M2]
    at org.springframework.cloud.netflix.feign.FeignClientFactory.getInstance(FeignClientFactory.java:113) ~[spring-cloud-netflix-core-1.1.0.M2.jar:1.1.0.M2]
    at org.springframework.cloud.netflix.feign.FeignClientFactoryBean.getOptional(FeignClientFactoryBean.java:120) ~[spring-cloud-netflix-core-1.1.0.M2.jar:1.1.0.M2]
    at org.springframework.cloud.netflix.feign.FeignClientFactoryBean.feign(FeignClientFactoryBean.java:71) ~[spring-cloud-netflix-core-1.1.0.M2.jar:1.1.0.M2]
    at org.springframework.cloud.netflix.feign.FeignClientFactoryBean.getObject(FeignClientFactoryBean.java:143) ~[spring-cloud-netflix-core-1.1.0.M2.jar:1.1.0.M2]
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    ... 40 common frames omitted

fix

@Autowired
    public void setSpringSwaggerConfig(SpringSwaggerConfig springSwaggerConfig) {
        this.springSwaggerConfig = springSwaggerConfig;
        //fix java.lang.NullPointerException com.mangofactory.swagger.models.property.field.FieldModelPropertyProvider.propertiesForSerialization
        springSwaggerConfig.jacksonSwaggerSupport();
    }

docs


codecraft
11.9k 声望2k 粉丝

当一个代码的工匠回首往事时,不因虚度年华而悔恨,也不因碌碌无为而羞愧,这样,当他老的时候,可以很自豪告诉世人,我曾经将代码注入生命去打造互联网的浪潮之巅,那是个很疯狂的时代,我在一波波的浪潮上留下...