![](/img/trans.png)
[英]Jackson parsing error: exception org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field “Results”
[英]Spring boot : org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field “XX” in WebSphere
我有一个执行反向Swagger
Yaml
的spring boot应用程序:
<plugin>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>2.3.1</version>
<executions>
<execution>
<id>generate-swagger-java</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${basedir}/src/main/resources/swagger/cview.yaml</inputSpec>
<apiPackage>client.api</apiPackage>
<modelPackage>client.model</modelPackage>
<output>${project.build.directory}/generated-sources</output>
<language>java</language>
<configOptions>
<dateLibrary>java8</dateLibrary>
<library>jersey2</library>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
与主类一起运行,效果很好
public static void main(final String[] args) {
SpringApplication.run(SpringBootApp.class, args);
}
但是,当我在WebSphere libertyCore
上使用SpringBootServletInitializer
运行它时,它会卡住,并在尝试调用Web服务时给我这些错误:
org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "id_entite" (Class client.model.GaEj), not marked as ignorable
Problem with reading the data, class client.model.SearchResultGaEj, ContentType: application/json;charset=UTF-8
问题是我与org.codehaus.jackson.*
没有任何依赖关系org.codehaus.jackson.*
我只使用com.fasterxml.jackson.datatype
缺省情况下, WebSphere
使用Codehaus Jackson
( 参考资料 )。 WebSphere
使用两种Class-loader模式 : Parent first
和Parent last
。 您需要确保应用程序使用的是FasterXML的 Jackson
, 而不是Codehause
Jackson
。 Spring Boot
没有任何自己的托管库,但是WebSphere
是Application Server
,它提供了许多已经连接的库,因此您无需为它们提供应用程序。
看到:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.