0
votes

I'm getting below exception while running a job in SpringBatch using sybase db. The schema have been created using - 'schema-sybase.sql' shipped with Spring Batch.

Spring-batch version - spring-batch-core-2.1.7

Error

2015-04-07 09:21:13,138 ERROR [org.springframework.batch.core.launch.support.CommandLineJobRunner] - org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback; SQL [SELECT JOB_INSTANCE_ID, JOB_NAME from BATCH_JOB_INSTANCE where JOB_NAME = ? and JOB_KEY = ?]; JZ006: Caught IOException: java.io.IOException: JZ0TC: Attempted conversion between an illegal pair of types.; nested exception is java.sql.SQLException: JZ006: Caught IOException: java.io.IOException: JZ0TC: Attempted conversion between an illegal pair of types.

Job Configuration

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns ="http://www.springframework.org/schema/batch"
       xmlns:beans="http://www.springframework.org/schema/beans"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                    http://www.springframework.org/schema/batch
                    http://www.springframework.org/schema/batch/spring-batch-2.1.xsd">

    <beans:import resource="../launch-context.xml"/>
                         
     <beans:bean id="helloWorld" class="com.chatar.batch.practice.HelloWorld"
    		scope="step">
    	<beans:property name="name" value="#{jobParameters[name]}"/>
	</beans:bean>

    <step id="helloWorldStep">
        <tasklet ref="helloWorld"/>
    </step>

    <job id="helloWorldJob" incrementer="idIncrementer">
        <step id="helloWorldStep1" parent="helloWorldStep"/>
         <listeners>
        	<listener ref="loggingListener"/>
    	</listeners>
    </job>
    
    <beans:bean id="loggingListener" class="com.chatar.batch.practice.listener.JobLoggerListener"/>
    
    <beans:bean id="idIncrementer" class="org.springframework.batch.core.launch.support.RunIdIncrementer"/>

</beans:beans>
2
What version of sybase and what version of the driver? - Michael Minella
driver - jconn-3.0.0, sybase - Adaptive Server Enterprise/15.7/EBF 21708 SMP SP110 /P/x86_64/Enterprise Linux/ase157sp11x/3546/64-bit/FBO/Fri Nov 8 05:39:38 2013 - TheCodingFrog

2 Answers

0
votes

It worked fine with BIGINT after upgrading JDBC driver to version 7.0.7 - jconn-7.0.7.jar

0
votes

Actually, it worked fine after changing BIGINT to INTEGER in schema-sybase.sql.

Look like some issue with sybase and JDBC driver compatibility.

The above solution is tested with jconn-3.0.0.jar