2017-07-25 50 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了。需要檢查是否有任何其他功能受到干擾,因爲這是一個非常古老的項目。

希望這可以幫助面臨類似問題的人。

相關問題