【发布时间】:2021-07-27 15:23:02
【问题描述】:
我的应用程序正在使用以下内容:
JDK 版本:Open JDK
jdk-11.0.11+9
Payara :5.2021.5
Spring 版本:5.2.7.RELEASE
jackson 版本:2.9.4。
Payara 5.2021.5 使用 Jackson 版本 2.10.2,而应用程序使用 Jackson 版本:2.9.4。看起来 SpringMVC 使用的一些 Jackson 方法的方法签名在 Jackson 2.10.2 中发生了变化。
服务器启动时,抛出以下异常:
Details: Location: org/springframework/http/converter/json/Jackson2ObjectMapperBuilder$XmlObjectMapperInitializer.create
(Lcom/fasterxml/jackson/core/JsonFactory;)Lcom/fasterxml/jackson/databind/ObjectMapper; @15: areturn Reason: Type 'com/fasterxml/jackson/dataformat/xml/XmlMapper' (current frame, stack[0]) is not assignable to 'com/fasterxml/jackson/databind/ObjectMapper' (from method signature)
我尝试通过在 glassfish-web.xml 中设置元素以及通过在 domain.xml 中将系统属性 fish.payara.classloading.delegate 设置为 false 来在本地禁用类加载层次结构
我还尝试按照文档中的建议将以下内容添加到 web.xml,以及 DispatcherServlet 的 init 参数,但似乎没有帮助-
<context-param>
<param-name>jersey.config.jsonFeature</param-name>
<param-value>JacksonFeature</param-value>
</context-param>
【问题讨论】:
标签: spring spring-mvc payara