最近需要将项目中所有fastjson换成Jackson,但问题来了,依赖去掉fastjson以后swagger-ui报错,不知道大,神有没有遇到,有没有办法解决或是其他方式替换
Caused by: com.google.common.util.concurrent.ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Lcom/alibaba/fastjson/serializer/PropertyFilter;
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212) ~[guava-20.0.jar:na]
at com.google.common.cache.LocalCache.get(LocalCache.java:4053) ~[guava-20.0.jar:na]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4057) ~[guava-20.0.jar:na]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4986) ~[guava-20.0.jar:na]
at springfox.documentation.schema.CachingModelDependencyProvider.dependentModels(CachingModelDependencyProvider.java:58) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.DefaultModelProvider.dependencies(DefaultModelProvider.java:128) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.CachingModelProvider.dependencies(CachingModelProvider.java:68) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.spring.web.scanners.ApiModelReader.populateDependencies(ApiModelReader.java:136) ~[springfox-spring-web-2.9.2.jar:null]
at springfox.documentation.spring.web.scanners.ApiModelReader.read(ApiModelReader.java:78) ~[springfox-spring-web-2.9.2.jar:null]
at springfox.documentation.spring.web.scanners.ApiListingScanner.scan(ApiListingScanner.java:133) ~[springfox-spring-web-2.9.2.jar:null]
at springfox.documentation.spring.web.scanners.ApiDocumentationScanner.scan(ApiDocumentationScanner.java:71) ~[springfox-spring-web-2.9.2.jar:null]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.scanDocumentation(DocumentationPluginsBootstrapper.java:101) ~[springfox-spring-web-2.9.2.jar:null]
at springfox.documentation.spring.web.plugins.DocumentationPluginsBootstrapper.start(DocumentationPluginsBootstrapper.java:167) ~[springfox-spring-web-2.9.2.jar:null]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173) ~[spring-context-4.3.25.RELEASE.jar:4.3.25.RELEASE]
... 14 common frames omitted
Caused by: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Lcom/alibaba/fastjson/serializer/PropertyFilter;
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212) ~[guava-20.0.jar:na]
at com.google.common.cache.LocalCache.get(LocalCache.java:4053) ~[guava-20.0.jar:na]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4057) ~[guava-20.0.jar:na]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4986) ~[guava-20.0.jar:na]
at springfox.documentation.schema.property.CachingModelPropertiesProvider.propertiesFor(CachingModelPropertiesProvider.java:64) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.DefaultModelDependencyProvider.propertiesFor(DefaultModelDependencyProvider.java:241) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.DefaultModelDependencyProvider.nonTrivialProperties(DefaultModelDependencyProvider.java:189) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.DefaultModelDependencyProvider.resolvedPropertiesAndFields(DefaultModelDependencyProvider.java:176) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.DefaultModelDependencyProvider.resolvedDependencies(DefaultModelDependencyProvider.java:120) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.DefaultModelDependencyProvider.maybeFromCollectionElementType(DefaultModelDependencyProvider.java:220) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.DefaultModelDependencyProvider.resolvedPropertiesAndFields(DefaultModelDependencyProvider.java:181) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.DefaultModelDependencyProvider.resolvedDependencies(DefaultModelDependencyProvider.java:120) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.DefaultModelDependencyProvider.maybeFromCollectionElementType(DefaultModelDependencyProvider.java:220) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.DefaultModelDependencyProvider.resolvedPropertiesAndFields(DefaultModelDependencyProvider.java:181) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.DefaultModelDependencyProvider.resolvedDependencies(DefaultModelDependencyProvider.java:120) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.DefaultModelDependencyProvider.dependentModels(DefaultModelDependencyProvider.java:79) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.CachingModelDependencyProvider$1.load(CachingModelDependencyProvider.java:50) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.CachingModelDependencyProvider$1.load(CachingModelDependencyProvider.java:48) ~[springfox-schema-2.9.2.jar:null]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3628) ~[guava-20.0.jar:na]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2336) ~[guava-20.0.jar:na]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2295) ~[guava-20.0.jar:na]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2208) ~[guava-20.0.jar:na]
... 27 common frames omitted
Caused by: java.lang.NoClassDefFoundError: Lcom/alibaba/fastjson/serializer/PropertyFilter;
at java.lang.Class.getDeclaredFields0(Native Method) ~[na:1.8.0_131]
at java.lang.Class.privateGetDeclaredFields(Class.java:2583) ~[na:1.8.0_131]
at java.lang.Class.getDeclaredFields(Class.java:1916) ~[na:1.8.0_131]
at com.fasterxml.jackson.databind.util.ClassUtil.getDeclaredFields(ClassUtil.java:937) ~[jackson-databind-2.8.11.3.jar:2.8.11.3]
at com.fasterxml.jackson.databind.introspect.AnnotatedClass._findFields(AnnotatedClass.java:835) ~[jackson-databind-2.8.11.3.jar:2.8.11.3]
at com.fasterxml.jackson.databind.introspect.AnnotatedClass._findFields(AnnotatedClass.java:832) ~[jackson-databind-2.8.11.3.jar:2.8.11.3]
at com.fasterxml.jackson.databind.introspect.AnnotatedClass.resolveFields(AnnotatedClass.java:599) ~[jackson-databind-2.8.11.3.jar:2.8.11.3]
at com.fasterxml.jackson.databind.introspect.AnnotatedClass.fields(AnnotatedClass.java:371) ~[jackson-databind-2.8.11.3.jar:2.8.11.3]
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._addFields(POJOPropertiesCollector.java:371) ~[jackson-databind-2.8.11.3.jar:2.8.11.3]
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.collectAll(POJOPropertiesCollector.java:302) ~[jackson-databind-2.8.11.3.jar:2.8.11.3]
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.getPropertyMap(POJOPropertiesCollector.java:267) ~[jackson-databind-2.8.11.3.jar:2.8.11.3]
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.getProperties(POJOPropertiesCollector.java:159) ~[jackson-databind-2.8.11.3.jar:2.8.11.3]
at com.fasterxml.jackson.databind.introspect.BasicBeanDescription._properties(BasicBeanDescription.java:144) ~[jackson-databind-2.8.11.3.jar:2.8.11.3]
at com.fasterxml.jackson.databind.introspect.BasicBeanDescription.findProperties(BasicBeanDescription.java:219) ~[jackson-databind-2.8.11.3.jar:2.8.11.3]
at springfox.documentation.schema.property.OptimizedModelPropertiesProvider.propertiesFor(OptimizedModelPropertiesProvider.java:124) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.property.OptimizedModelPropertiesProvider.propertiesFor(OptimizedModelPropertiesProvider.java:118) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.property.CachingModelPropertiesProvider$1.load(CachingModelPropertiesProvider.java:56) ~[springfox-schema-2.9.2.jar:null]
at springfox.documentation.schema.property.CachingModelPropertiesProvider$1.load(CachingModelPropertiesProvider.java:54) ~[springfox-schema-2.9.2.jar:null]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3628) ~[guava-20.0.jar:na]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2336) ~[guava-20.0.jar:na]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2295) ~[guava-20.0.jar:na]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2208) ~[guava-20.0.jar:na]
... 48 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.alibaba.fastjson.serializer.PropertyFilter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_131]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_131]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) ~[na:1.8.0_131]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_131]
... 70 common frames omitted