Announcement Announcement Module
Collapse
No announcement yet.
InfrastructureException on java.sql.Connection.createStatement(III) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • InfrastructureException on java.sql.Connection.createStatement(III)

    Getting Error on createStatement when using JdbcCursorItemReader to go after a table on Sybase (see stack trace below).
    Same code works against DB2 (8.1) and Oracle (10g).

    Additional info (sections from Xml and properties file) pasted AFTER the
    stack trace.

    I am using SpringBatch 1.0.0m5.
    Any help will be much appreciated.

    ===========Stack Trace================

    11:49:29,276 ERROR main MyJobRunner:202 - Job Terminated in error:
    org.springframework.batch.io.exception.Infrastruct ureException: java.lang.AbstractMethodError: java/sql/Connection.createStatement(III)Ljava/sql/Statement;
    at org.springframework.batch.execution.job.SimpleJob. rethrow(SimpleJob.java:186)
    at org.springframework.batch.execution.job.SimpleJob. execute(SimpleJob.java:110)
    at org.springframework.batch.execution.launch.SimpleJ obLauncher$1.run(SimpleJobLauncher.java:87)
    at org.springframework.core.task.SyncTaskExecutor.exe cute(SyncTaskExecutor.java:49)
    at org.springframework.batch.execution.launch.SimpleJ obLauncher.run(SimpleJobLauncher.java:82)
    at com.foobar.datamig.app.MyJobRunner.start(MyJobRunn er.java:198)
    at com.foobar.datamig.app.MyJobRunner.main(MyJobRunne r.java:244)
    Caused by:
    java.lang.AbstractMethodError: java/sql/Connection.createStatement(III)Ljava/sql/Statement;
    at org.apache.commons.dbcp.DelegatingConnection.creat eStatement(DelegatingConnection.java:354)
    at org.apache.commons.dbcp.PoolingDataSource$PoolGuar dConnectionWrapper.createStatement(PoolingDataSour ce.java:360)
    at org.springframework.batch.io.cursor.JdbcCursorItem Reader.executeQuery(JdbcCursorItemReader.java:300)
    at org.springframework.batch.io.cursor.JdbcCursorItem Reader.open(JdbcCursorItemReader.java:398)
    at org.springframework.batch.item.stream.CompositeIte mStream.open(CompositeItemStream.java:105)
    at org.springframework.batch.execution.step.ItemOrien tedStep.execute(ItemOrientedStep.java:267)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:64)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:615)
    at org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:310)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.invokeJoinpoint(ReflectiveMethodInvocat ion.java:182)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :149)
    at org.springframework.aop.aspectj.AspectJAfterAdvice .invoke(AspectJAfterAdvice.java:42)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.aspectj.AspectJAfterThrowi ngAdvice.invoke(AspectJAfterThrowingAdvice.java:54 )
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.framework.adapter.MethodBe foreAdviceInterceptor.invoke(MethodBeforeAdviceInt erceptor.java:50)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.interceptor.ExposeInvocati onInterceptor.invoke(ExposeInvocationInterceptor.j ava:90)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy1.execute(Unknown Source)
    at org.springframework.batch.execution.job.SimpleJob. execute(SimpleJob.java:94)
    ... 5 more

    =========pertinent jar manifest info ===============

    jconn2.jar
    Specification-Title: "jConnect for JDBC 2.0"
    Implementation-Version: "Build (25159)"
    Specification-Vendor: "Sybase, Inc."
    Specification-Version: "5.5"


    ===========sections from Job XML================

    <bean id="simpleSample" parent="simpleJob">
    <property name="steps">
    <list>
    <bean id="step1" parent="simpleStep">
    <property name="itemReader"
    ref="sqlItemReader" />
    <property name="itemWriter">
    <bean
    class="com.foobar.writer.MyItemWriter">
    <property name="writerDao" ref="writerDao" />
    </bean>
    </property>
    </bean>
    </list>
    </property>
    </bean>

    <bean id="sqlItemReader"
    class="org.springframework.batch.io.cursor.JdbcCur sorItemReader">
    <property name="dataSource" ref="sybaseDataSource" />
    <property name="sql"
    value="SELECT * FROM Students" />
    <property name="mapper">
    <bean
    class="com.foobar.mapping.StudentRowMapper" />
    </property>
    </bean>

    ======sections from properties file========

    datamig.fts.jdbc.driver=com.sybase.jdbc2.jdbc.SybD river
    datamig.fts.jdbc.url=jdbc:sybase:Tds:host:9999/sydb
    datamig.fts.jdbc.user=xxxxxx
    datamig.fts.jdbc.password=********
    datamig.fts.schema=

    ====== command line args on invocation ======

    java MyJobRunner MyJobRunner-context.xml simpleSample

  • #2
    From the Javadocs of AbstractMethdodError:

    "this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled."

    Looks like your database driver might be incompatible (with what I don't know, DBCP?).

    You might want to upgrade to rc1 soon as well (InfrastructureException doesn't exist in Spring Batch any more).
    Last edited by Dave Syer; Mar 18th, 2008, 02:54 PM. Reason: spelling

    Comment


    • #3
      Thanks Dave.

      I upgraded to 1.0 rc1 and switched to jTds driver from sourceforge
      and now I am able to connect to Sybase.

      I have posted my earlier dbcp/jconnect issue on DataAccess forum of
      Spring and awaiting response.

      Comment

      Working...
      X