构建项目时获取低于杰克逊异常
Getting Below Jackson exception while building the project
将 Springboot 项目从 spring 1.1.1 版本迁移到 2.3.12 版本时出现低于构建异常。请在这里帮忙。
Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.introspect.AnnotatedMember.getType(Lcom/fasterxml/jackson/databind/type/TypeBindings;)Lcom/fasterxml/jackson/databind/JavaType;
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:377)
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:183)
at io.swagger.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:100)
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:234)
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:183)
at io.swagger.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:100)
at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:159)
at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:110)
at io.swagger.converter.ModelConverterContextImpl.resolveProperty(ModelConverterContextImpl.java:80)
at io.swagger.converter.ModelConverters.readAsProperty(ModelConverters.java:58)
at io.swagger.jaxrs.Reader.addResponse(Reader.java:1018)
at io.swagger.jaxrs.Reader.parseMethod(Reader.java:940)
at io.swagger.jaxrs.Reader.read(Reader.java:322)
at io.swagger.jaxrs.Reader.read(Reader.java:172)
at io.swagger.jaxrs.config.BeanConfig.scanAndRead(BeanConfig.java:242)
at io.swagger.jaxrs.config.BeanConfig.setScan(BeanConfig.java:221)
at org.apache.cxf.jaxrs.swagger.Swagger2Feature.initBeanConfig(Swagger2Feature.java:354)
at org.apache.cxf.jaxrs.swagger.Swagger2Feature.addSwaggerResource(Swagger2Feature.java:201)
at org.apache.cxf.jaxrs.swagger.AbstractSwaggerFeature.initialize(AbstractSwaggerFeature.java:68)
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.applyFeatures(JAXRSServerFactoryBean.java:252)
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:196)
at com.daimler.icon2.contractcreation.general.service.config.ServiceConfig.jaxRsServer(ServiceConfig.java:138)
at com.daimler.icon2.contractcreation.general.service.config.ServiceConfig$$EnhancerBySpringCGLIB$437023.CGLIB$jaxRsServer(<generated>)
at com.daimler.icon2.contractcreation.general.service.config.ServiceConfig$$EnhancerBySpringCGLIB$437023$$FastClassBySpringCGLIB$d5367f.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
at com.daimler.icon2.contractcreation.general.service.config.ServiceConfig$$EnhancerBySpringCGLIB$437023.jaxRsServer(<generated>)
at sun.reflect.GeneratedMethodAccessor334.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 68 common frames omitted
这个问题似乎与版本不匹配有关。此方法前段时间已删除。
在 swagger 上有一个已关闭的问题 plug-in
https://github.com/swagger-api/swagger-core/issues/3554
迁移版本差异,我认为 spring 现在随更新的 Jackson 库一起提供,其中删除了此方法。
尝试升级你 swagger plug-in 版本。
正在将 Swagger 版本从 1.5.13 更新到 1.6.5,问题已解决。
将 Springboot 项目从 spring 1.1.1 版本迁移到 2.3.12 版本时出现低于构建异常。请在这里帮忙。
Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.introspect.AnnotatedMember.getType(Lcom/fasterxml/jackson/databind/type/TypeBindings;)Lcom/fasterxml/jackson/databind/JavaType;
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:377)
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:183)
at io.swagger.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:100)
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:234)
at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:183)
at io.swagger.converter.ModelConverterContextImpl.resolve(ModelConverterContextImpl.java:100)
at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:159)
at io.swagger.jackson.ModelResolver.resolveProperty(ModelResolver.java:110)
at io.swagger.converter.ModelConverterContextImpl.resolveProperty(ModelConverterContextImpl.java:80)
at io.swagger.converter.ModelConverters.readAsProperty(ModelConverters.java:58)
at io.swagger.jaxrs.Reader.addResponse(Reader.java:1018)
at io.swagger.jaxrs.Reader.parseMethod(Reader.java:940)
at io.swagger.jaxrs.Reader.read(Reader.java:322)
at io.swagger.jaxrs.Reader.read(Reader.java:172)
at io.swagger.jaxrs.config.BeanConfig.scanAndRead(BeanConfig.java:242)
at io.swagger.jaxrs.config.BeanConfig.setScan(BeanConfig.java:221)
at org.apache.cxf.jaxrs.swagger.Swagger2Feature.initBeanConfig(Swagger2Feature.java:354)
at org.apache.cxf.jaxrs.swagger.Swagger2Feature.addSwaggerResource(Swagger2Feature.java:201)
at org.apache.cxf.jaxrs.swagger.AbstractSwaggerFeature.initialize(AbstractSwaggerFeature.java:68)
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.applyFeatures(JAXRSServerFactoryBean.java:252)
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:196)
at com.daimler.icon2.contractcreation.general.service.config.ServiceConfig.jaxRsServer(ServiceConfig.java:138)
at com.daimler.icon2.contractcreation.general.service.config.ServiceConfig$$EnhancerBySpringCGLIB$437023.CGLIB$jaxRsServer(<generated>)
at com.daimler.icon2.contractcreation.general.service.config.ServiceConfig$$EnhancerBySpringCGLIB$437023$$FastClassBySpringCGLIB$d5367f.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
at com.daimler.icon2.contractcreation.general.service.config.ServiceConfig$$EnhancerBySpringCGLIB$437023.jaxRsServer(<generated>)
at sun.reflect.GeneratedMethodAccessor334.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 68 common frames omitted
这个问题似乎与版本不匹配有关。此方法前段时间已删除。
在 swagger 上有一个已关闭的问题 plug-in https://github.com/swagger-api/swagger-core/issues/3554
迁移版本差异,我认为 spring 现在随更新的 Jackson 库一起提供,其中删除了此方法。
尝试升级你 swagger plug-in 版本。
正在将 Swagger 版本从 1.5.13 更新到 1.6.5,问题已解决。