2017-07-25 83 views
1

尝试运行spring批处理以加载执行列表时出现此错误。使用spring批处理获取执行列表时发生java.lang.IllegalAccessError

java.lang.IllegalAccessError: tried to access method org.springframework.batch.core.repository.dao.JdbcJobExecutionDao.getJobParameters(Ljava/lang/Long;)Lorg/springframework/batch/core/JobParameters; from class org.springframework.batch.admin.service.JdbcSearchableJobExecutionDao

做一些分析后,我发现JdbcJobExecutionDao是春季批次的一部分,并且具有getJobParameters的实现()的保护方法,同时,JdbcSearchableJobExecutionDao是春季批次管理员已经延长了JdbcJobExecutionDao的一部分。

所以按照Oracle文档,它说,IllegalAccessError是 -

Thrown if an application attempts to access or modify a field or to call a method that it does not have access to.

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.

我不明白,我并没有对这些罐子/类控制。我在使用它们时做错了什么?或者我用于两个罐子的版本有问题。

弹簧批次 - 版本2.2.0.RELEASE

弹簧批次管理 - 版本1.3.0.BUILD-快照(与1.3.0.RELEASE也试过)

Refered到网站 - java.lang.IllegalAccessError: tried to access method

https://github.com/spring-projects/spring-batch/blob/master/spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcJobExecutionDao.java

https://github.com/spring-projects/spring-batch-admin/blob/master/spring-batch-admin-manager/src/main/java/org/springframework/batch/admin/service/JdbcSearchableJobExecutionDao.java

回答

0

所以,我通过使用道具固定此呃版本。这是spring-batch-admin之间弹簧批次&之间的版本不匹配问题。我提到这个春天的文档网站,并尝试推荐的版本,它的工作!

http://docs.spring.io/spring-batch-admin/spring-batch-admin-manager/dependencies.html

所以,现在我使用

2.2.7.RELEASE(Spring-Batch)

1.3.1.RELEASE(Spring-Batch-Admin)

,我没有得到java.lang.IllegalAccessError了。需要检查是否有任何其他功能受到干扰,因为这是一个非常古老的项目。

希望这可以帮助面临类似问题的人。

相关问题