java - Spring batch 2.4.1 + Wildfly 20 final - java.lang.NoSuchFieldError: BLOCK_UNSAFE_POLYMORPHIC_BASE_TYPES
问题描述
我正在尝试在 Wildfly server 20 final 上执行 Spring 批处理应用程序,但出现以下错误,
如果我使用内置的 tomcat 服务器,相同的代码可以正常工作。
Caused by: java.lang.NoSuchFieldError: BLOCK_UNSAFE_POLYMORPHIC_BASE_TYPES
at org.springframework.batch.core.repository.dao.Jackson2ExecutionContextStringSerializer.<init>(Jackson2ExecutionContextStringSerializer.java:119)
at org.springframework.batch.core.repository.support.JobRepositoryFactoryBean.afterPropertiesSet(JobRepositoryFactoryBean.java:192)
at org.springframework.boot.autoconfigure.batch.BasicBatchConfigurer.createJobRepository(BasicBatchConfigurer.java:133)
at org.springframework.boot.autoconfigure.batch.BasicBatchConfigurer.initialize(BasicBatchConfigurer.java:101)
at org.springframework.boot.autoconfigure.batch.BasicBatchConfigurer.afterPropertiesSet(BasicBatchConfigurer.java:95)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1847)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1784)
解决方案
I get this problem too, it looks like springbatch 4.3.0 has introduced a dependency on jackson databind 2.11.
Here's the spring commit: https://github.com/spring-projects/spring-batch/commit/9a79b4572d0aa4bec38fe90957c850920b7f9cea
And the databind commit: https://github.com/FasterXML/jackson-databind/commit/fa402574f99daa10410682160365df0867abe4d4
-> So need to downgrade to 4.2.x or upgrade jackson to 2.11
(Updated: Commit was introduced in springbatch 4.3.0, not 4.3.1)
推荐阅读
- mysql - MySQL选择其中值= 0
- spring - 使用 JDBC 的查询运行速度要慢得多
- python - 使用 JSON 模块序列化复杂对象
- c++ - 将 K 列表与 N 项合并不适用于大 K 或 N(K 或 N > 200)
- machine-learning - 如何训练模型按预定义的含义区分/分类单词?
- xcode - Xcode 11:吊销证书,现在无法提交应用程序
- file - 我在 IIB 上使用收集器节点来收集消息。有人可以在收集器节点之后使用示例 ESQL 来指导处理消息收集吗?
- angular - 如何在 Angular 组件中测试订阅的副作用
- python - python中的def在C中意味着什么
- javascript - 返回多种类型的函数,以逗号分隔。打字稿中的内容是什么?