Hi,
I am trying to execute the FootballJobFunctionalTests through Junit. The database used is hsqldb. I get the following error:
org.springframework.dao.DataIntegrityViolationExce ption: PreparedStatementCallback; SQL [UPDATE BATCH_STEP set STATUS = ?, RESTART_DATA = ? where ID = ?]; Value too long in statement [UPDATE BATCH_STEP set STATUS = ?, RESTART_DATA = ? where ID = ?]; nested exception is java.sql.SQLException: Value too long in statement [UPDATE BATCH_STEP set STATUS = ?, RESTART_DATA = ? where ID = ?]
at org.springframework.jdbc.support.SQLStateSQLExcept ionTranslator.translate(SQLStateSQLExceptionTransl ator.java:111)
at org.springframework.jdbc.support.SQLErrorCodeSQLEx ceptionTranslator.translate(SQLErrorCodeSQLExcepti onTranslator.java:322)
at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:582)
at org.springframework.jdbc.core.JdbcTemplate.update( JdbcTemplate.java:767)
at org.springframework.jdbc.core.JdbcTemplate.update( JdbcTemplate.java:825)
at org.springframework.jdbc.core.JdbcTemplate.update( JdbcTemplate.java:833)
at org.springframework.batch.execution.repository.dao .SqlStepDao.update(SqlStepDao.java:256)
at org.springframework.batch.execution.repository.Sim pleJobRepository.update(SimpleJobRepository.java:2 03)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoi npointUsingReflection(AopUtils.java:301)
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.interceptor.ExposeInvocati onInterceptor.invoke(ExposeInvocationInterceptor.j ava:89)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :171)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy0.update(Unknown Source)
at org.springframework.batch.execution.step.simple.Si mpleStepExecutor.updateStatus(SimpleStepExecutor.j ava:309)
at org.springframework.batch.execution.step.simple.Si mpleStepExecutor.process(SimpleStepExecutor.java:2 73)
at org.springframework.batch.execution.job.DefaultJob Executor.run(DefaultJobExecutor.java:97)
at org.springframework.batch.execution.launch.SimpleJ obExecutorFacade.start(SimpleJobExecutorFacade.jav a:199)
at org.springframework.batch.execution.launch.SimpleJ obLauncher.runInternal(SimpleJobLauncher.java:248)
at org.springframework.batch.execution.launch.SimpleJ obLauncher$1.run(SimpleJobLauncher.java:292)
at org.springframework.core.task.SyncTaskExecutor.exe cute(SyncTaskExecutor.java:49)
at org.springframework.batch.execution.launch.SimpleJ obLauncher.run(SimpleJobLauncher.java:280)
at org.springframework.batch.sample.AbstractBatchLaun cherTests.testLaunchJob(AbstractBatchLauncherTests .java:84)
at org.springframework.batch.sample.AbstractValidatin gBatchLauncherTests.testLaunchJob(AbstractValidati ngBatchLauncherTests.java:34)
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:585)
at junit.framework.TestCase.runTest(TestCase.java:164 )
at junit.framework.TestCase.runBare(TestCase.java:130 )
at org.springframework.test.ConditionalTestCase.runBa re(ConditionalTestCase.java:76)
at junit.framework.TestResult$1.protect(TestResult.ja va:106)
at junit.framework.TestResult.runProtected(TestResult .java:124)
at junit.framework.TestResult.run(TestResult.java:109 )
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:2 30)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit 3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:196)
Caused by: java.sql.SQLException: Value too long in statement [UPDATE BATCH_STEP set STATUS = ?, RESTART_DATA = ? where ID = ?]
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdat e(Unknown Source)
at org.springframework.jdbc.core.JdbcTemplate$2.doInP reparedStatement(JdbcTemplate.java:773)
at org.springframework.jdbc.core.JdbcTemplate.execute (JdbcTemplate.java:566)
... 46 more
I tried the same test with oracle10g as database and got the error as shown in football_Error.jpg
Let me know the solution in both the cases.


Reply With Quote
