Announcement Announcement Module
Collapse
No announcement yet.
Error while starting up the job with sybase Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error while starting up the job with sybase

    Hi ,

    I have setup an demo sample application in my eclipse.

    While i start the job i am getting following exception .

    17:41:20,423 INFO main ClassPathXmlApplicationContext:411 - Refreshing org.springframework.context.support.ClassPathXmlAp plicationContext@5d9084: display name [org.springframework.context.support.ClassPathXmlAp plicationContext@5d9084]; startup date [Tue Nov 09 17:41:20 GMT 2010]; root of context hierarchy
    17:41:20,532 INFO main XmlBeanDefinitionReader:323 - Loading XML bean definitions from class path resource [FileToTableJob.xml]
    17:41:20,813 INFO main XmlBeanDefinitionReader:323 - Loading XML bean definitions from class path resource [DB-JOBREPOSITORY.xml]
    17:41:20,985 INFO main DefaultListableBeanFactory:467 - Overriding bean definition for bean 'careerProcessorJob': replacing [Generic bean: class [org.springframework.batch.core.job.flow.support.Si mpleFlow]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.springframework.batch.core.job.flow.FlowJob]; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
    17:41:21,001 INFO main ClassPathXmlApplicationContext:426 - Bean factory for application context [org.springframework.context.support.ClassPathXmlAp plicationContext@5d9084]: org.springframework.beans.factory.support.DefaultL istableBeanFactory@5dfaf1
    17:41:21,126 INFO main DefaultListableBeanFactory:414 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultL istableBeanFactory@5dfaf1: defining beans [jobRepository-dataSource,jobRepository-transactionManager,jobRepository,asyncTaskExecutor ,syncTaskExecutor,jobLauncher,jobExplorer,columnIn crementerParent,playerFileItemReader,careerProcess or,playerDBWriter,playerFileItemReaderv2,careerPro cessorv2,playerDBWriterv2,dynamicJobParameters,org .springframework.batch.core.scope.internalStepScop e,org.springframework.beans.factory.config.CustomE ditorConfigurer,step1,step2,careerProcessorJob,pro motionListener,stepExecutionListener]; root of factory hierarchy
    17:41:21,626 INFO main SimpleJobLauncher:156 - No TaskExecutor has been set, defaulting to synchronous executor.
    17:41:22,969 INFO main XmlBeanDefinitionReader:323 - Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
    17:41:23,032 INFO main SQLErrorCodesFactory:128 - SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
    17:41:23,048 WARN main SQLErrorCodesFactory:230 - Error while extracting database product name - falling back to empty error codes
    org.springframework.jdbc.support.MetaDataAccessExc eption: Error while extracting DatabaseMetaData; nested exception is com.sybase.jdbc3.jdbc.SybSQLException: A wrong datastream has been sent to the server. The server was expecting token 32 but got the token 33. This is an internal error.


    at org.springframework.jdbc.support.JdbcUtils.extract DatabaseMetaData(JdbcUtils.java:296)
    at org.springframework.jdbc.support.JdbcUtils.extract DatabaseMetaData(JdbcUtils.java:320)
    at org.springframework.jdbc.support.SQLErrorCodesFact ory.getErrorCodes(SQLErrorCodesFactory.java:216)
    at org.springframework.jdbc.support.SQLErrorCodeSQLEx ceptionTranslator.setDataSource(SQLErrorCodeSQLExc eptionTranslator.java:140)
    at org.springframework.jdbc.support.SQLErrorCodeSQLEx ceptionTranslator.<init>(SQLErrorCodeSQLExceptionT ranslator.java:103)
    at org.springframework.jdbc.support.JdbcAccessor.getE xceptionTranslator(JdbcAccessor.java:99)
    at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:607)
    at org.springframework.jdbc.core.JdbcTemplate.update( JdbcTemplate.java:792)
    at org.springframework.jdbc.core.JdbcTemplate.update( JdbcTemplate.java:850)
    at org.springframework.batch.core.repository.dao.Jdbc ExecutionContextDao.persistSerializedContext(JdbcE xecutionContextDao.java:176)
    at org.springframework.batch.core.repository.dao.Jdbc ExecutionContextDao.saveExecutionContext(JdbcExecu tionContextDao.java:133)
    at org.springframework.batch.core.repository.support. SimpleJobRepository.createJobExecution(SimpleJobRe pository.java:138)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:307)
    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.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:106)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy0.createJobExecution(Unknown Source)
    at org.springframework.batch.core.launch.support.Simp leJobLauncher.run(SimpleJobLauncher.java:102)
    at org.springframework.batch.core.launch.support.Comm andLineJobRunner.start(CommandLineJobRunner.java:2 07)
    at org.springframework.batch.core.launch.support.Comm andLineJobRunner.main(CommandLineJobRunner.java:25 4)
    Caused by: com.sybase.jdbc3.jdbc.SybSQLException: A wrong datastream has been sent to the server. The server was expecting token 32 but got the token 33. This is an internal error.

    at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
    at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source)
    at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unkn own Source)
    at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unkn own Source)
    at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unkn own Source)
    at com.sybase.jdbc3.jdbc.SybStatement.queryLoop(Unkno wn Source)
    at com.sybase.jdbc3.jdbc.SybStatement.executeQuery(Un known Source)
    at com.sybase.jdbc3.jdbc.SybPreparedStatement.execute Query(Unknown Source)
    at com.sybase.jdbc3.jdbc.SybDatabaseMetaData.a(Unknow n Source)
    at com.sybase.jdbc3.jdbc.SybDatabaseMetaData.getDatab aseProductName(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.jdbc.support.JdbcUtils$1.proce ssMetaData(JdbcUtils.java:325)
    at org.springframework.jdbc.support.JdbcUtils.extract DatabaseMetaData(JdbcUtils.java:290)
    ... 25 more


    Could any one let me know why this error could occur .

    Resources :

    1) Database : sybase 12.5
    2) org.springframework.batch.core-2.0.0.RELEASE.jar


    Also i had to create tables manually for sybase 12.5 as BIGINT and CLOB not supported . Please find the db scripts used .


    /* Create tables */
    CREATE TABLE BATCH_STEP_EXECUTION_SEQ (ID INT NULL) ;
    INSERT INTO BATCH_STEP_EXECUTION_SEQ values(0);
    CREATE TABLE BATCH_JOB_EXECUTION_SEQ (ID INT NULL) ;
    INSERT INTO BATCH_JOB_EXECUTION_SEQ values(0);
    CREATE TABLE BATCH_JOB_SEQ (ID INT NULL) ;
    INSERT INTO BATCH_JOB_SEQ values(2);

    sp_help BATCH_JOB_SEQ


    CREATE TABLE BATCH_JOB_INSTANCE (
    JOB_INSTANCE_ID INT ,
    VERSION INT,
    JOB_NAME VARCHAR(100) NULL ,
    JOB_KEY VARCHAR(2500)
    );

    CREATE TABLE BATCH_JOB_PARAMS (
    JOB_INSTANCE_ID INT NULL ,
    TYPE_CD VARCHAR(6) NULL ,
    KEY_NAME VARCHAR(100) NULL ,
    STRING_VAL VARCHAR(250) ,
    DATE_VAL DATETIME,
    LONG_VAL INT ,
    DOUBLE_VAL DOUBLE PRECISION,

    );


    CREATE TABLE BATCH_JOB_EXECUTION (
    JOB_EXECUTION_ID INT ,
    VERSION INT,
    JOB_INSTANCE_ID INT NULL,
    CREATE_TIME DATETIME NULL,
    START_TIME DATETIME NULL ,
    END_TIME DATETIME NULL ,
    STATUS VARCHAR(10),
    EXIT_CODE VARCHAR(20),
    EXIT_MESSAGE VARCHAR(2500),
    LAST_UPDATED DATETIME,

    ) ;

    CREATE TABLE BATCH_STEP_EXECUTION (
    STEP_EXECUTION_ID INT ,
    VERSION INT NULL,
    STEP_NAME VARCHAR(100) NULL,
    JOB_EXECUTION_ID INT NULL,
    START_TIME DATETIME NULL ,
    END_TIME DATETIME NULL ,
    STATUS VARCHAR(10),
    COMMIT_COUNT INT ,
    READ_COUNT INT ,
    FILTER_COUNT INT ,
    WRITE_COUNT INT ,
    READ_SKIP_COUNT INT ,
    WRITE_SKIP_COUNT INT ,
    PROCESS_SKIP_COUNT INT ,
    ROLLBACK_COUNT INT ,
    EXIT_CODE VARCHAR(20) ,
    EXIT_MESSAGE VARCHAR(2500) ,
    LAST_UPDATED DATETIME,

    ) ;


    CREATE TABLE BATCH_JOB_EXECUTION_CONTEXT (
    JOB_EXECUTION_ID INT ,
    SHORT_CONTEXT TEXT NULL,
    SERIALIZED_CONTEXT TEXT NULL,

    ) ;


    CREATE TABLE BATCH_STEP_EXECUTION_CONTEXT (
    STEP_EXECUTION_ID INT ,
    SHORT_CONTEXT VARCHAR(2500) NULL,
    SERIALIZED_CONTEXT TEXT NULL,

    );

    Please help me .

  • #2
    Sounds like a driver error - can you try the same thing using the jTDS driver?

    Also, see if this thread has additional info for you - http://community.jboss.org/message/557138

    -Thomas

    Comment


    • #3
      Hi Thomas ,

      Thanks for the reply. It helped me to figure out the issue.

      Thanks ..

      Comment

      Working...
      X