티스토리 뷰

배치 기능 개발 중 다음과 같은 오류가 발생하였다. 

[18:18:17.212][ERROR][org.springframework.batch.core.step.AbstractStep.execute:line237] - Encountered an error executing step workerStep in job samplePartitionerJob
java.lang.AbstractMethodError: Receiver class oracle.jdbc.driver.OraclePreparedStatementWrapper does not define or inherit an implementation of the resolved method abstract closeOnCompletion()V of interface java.sql.Statement.
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.closeOnCompletion(HikariProxyPreparedStatement.java)
	at org.apache.ibatis.executor.SimpleExecutor.doQueryCursor(SimpleExecutor.java:75)
	at org.apache.ibatis.executor.BaseExecutor.queryCursor(BaseExecutor.java:178)
	at org.apache.ibatis.executor.CachingExecutor.queryCursor(CachingExecutor.java:82)

다른 배치 기능은 다 잘되었는데 유독 MyBatisCursorItemReader를 사용하는 Partitioner 기능만 이런 오류가 발생을 한다. datasource가 정상적으로 잘 설정이 되어 있고 다른 기능들은 모두 정상동작을 한다. 

 

원인은 못찾았지만 해결은 했다. 바로 ojdbc의 버전을 높였더니 된다.

필자가 사용하고 있던 ojdbc는 6 버전이었다. 그리고 oracle은 12c 버전을 사용중이다. 또 java는 11을 사용중이다.

Oracle Database version JDBC Jar files specific to the release
21.1 ojdbc11.jar with JDK11, JDK12, JDK13, JDK14 and JDK15
ojdbc8.jar with JDK8, JDK11, JDK12, JDK13, JDK14 and JDK15
19.x ojdbc10.jar with JDK10, JDK11
ojdbc8.jar with JDK8, JDK9, JDK11
18.3 ojdbc8.jar with JDK8, JDK9, JDK10, JDK11
12.2 or 12cR2 ojdbc8.jar with JDK 8
12.1 or 12cR1 ojdbc7.jar with JDK 7 and JDK 8
ojdbc6.jar with JDK 6
11.2 or 11gR2 ojdbc6.jar with JDK 6, JDK 7, and JDK 8
(Note: JDK7 and JDK8 are supported in 11.2.0.3 and 11.2.0.4 only)
ojdbc5.jar with JDK 5

 이 표를 봤을때 그럼 사용해야 하는 ojdbc는 7이나 8인데 jdk7도 거의 사용하지 않으니 8로 결정! 요즘에는 이게 제일 무난한것 같다. 

 

끝!

댓글
최근에 올라온 글
최근에 달린 댓글
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30