我有一个弹簧启动应用程序执行反向Swagger
Yaml
:
<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);
}
但是当我在SpringBootServletInitializer
上使用WebSphere libertyCore
运行它时,它会卡住并在我尝试调用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
问题是我与qazxsw poi没有任何依赖关系
我只使用org.codehaus.jackson.*
默认情况下,com.fasterxml.jackson.datatype
使用WebSphere
(Codehaus Jackson
)。 reference使用两个WebSphere
:Class-loader modes和Parent first
。您需要确保该应用程序使用来自Parent last
的Jackson
而不是FasterXML。 Codehause
没有任何自己的托管库,但Spring Boot
是一个WebSphere
,它提供了许多已经附加的库,因此您不需要为它们提供应用程序。
看到: