zhao190775705 opened a new issue #14580:
URL: https://github.com/apache/shardingsphere/issues/14580
error--------
org.mybatis.spring.MyBatisSystemException: nested exception is
org.apache.ibatis.executor.ExecutorException: Error getting generated key or
setting result to parameter object. Cause:
org.apache.ibatis.executor.result.ResultMapException: Error attempting to get
column #1 from result set. Cause: java.lang.NullPointerException: ResultSet
should call next or has no more data.
at
org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:96)
at
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)
at com.sun.proxy.$Proxy252.insert(Unknown Source)
at
org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
at
org.apache.ibatis.binding.MapperProxy$PlainMethodInvoker.invoke(MapperProxy.java:145)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:86)
at com.sun.proxy.$Proxy431.insertByBatch(Unknown Source)
at com.easybii.api.EcTest.tst18(EcTest.java:360)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at
org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
at
org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
at
org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at
org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at
com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at
com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:221)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: org.apache.ibatis.executor.ExecutorException: Error getting
generated key or setting result to parameter object. Cause:
org.apache.ibatis.executor.result.ResultMapException: Error attempting to get
column #1 from result set. Cause: java.lang.NullPointerException: ResultSet
should call next or has no more data.
at
org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator.processBatch(Jdbc3KeyGenerator.java:88)
at
org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator.processAfter(Jdbc3KeyGenerator.java:71)
at
org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:51)
at
org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
at
org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
at
org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
at
org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:194)
at
org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427)
... 35 more
Caused by: org.apache.ibatis.executor.result.ResultMapException: Error
attempting to get column #1 from result set. Cause:
java.lang.NullPointerException: ResultSet should call next or has no more data.
at
org.apache.ibatis.type.BaseTypeHandler.getResult(BaseTypeHandler.java:96)
at
org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator$KeyAssigner.assign(Jdbc3KeyGenerator.java:270)
at
org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator.lambda$assignKeysToParamMap$3(Jdbc3KeyGenerator.java:170)
at java.util.ArrayList.forEach(ArrayList.java:1259)
at
org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator.assignKeysToParamMap(Jdbc3KeyGenerator.java:170)
at
org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator.assignKeys(Jdbc3KeyGenerator.java:97)
at
org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator.processBatch(Jdbc3KeyGenerator.java:85)
... 48 more
Caused by: java.lang.NullPointerException: ResultSet should call next or has
no more data.
at
com.google.common.base.Preconditions.checkNotNull(Preconditions.java:805)
at
org.apache.shardingsphere.driver.jdbc.core.resultset.GeneratedKeysResultSet.checkStateForGetData(GeneratedKeysResultSet.java:243)
at
org.apache.shardingsphere.driver.jdbc.core.resultset.GeneratedKeysResultSet.getInt(GeneratedKeysResultSet.java:131)
at
org.apache.ibatis.type.IntegerTypeHandler.getNullableResult(IntegerTypeHandler.java:44)
at
org.apache.ibatis.type.IntegerTypeHandler.getNullableResult(IntegerTypeHandler.java:26)
at
org.apache.ibatis.type.BaseTypeHandler.getResult(BaseTypeHandler.java:94)
... 54 more
mybatis xml--
<insert id="insertByBatch" keyProperty="id" useGeneratedKeys="true"
parameterType="list">
insert into crm_bidding
(id, project_code, project_title,
project_date, purchaser_url, purchaser,
update_id, update_time,
create_time, creator_id, note,project_phase,project_period_start,
project_period_end,province_id,project_address,type,company_name,amount_invested,project_title_hash
)
values
<foreach collection ="list" item="item" separator =",">
<if test="item.isUpdate == null">
(#{item.id,jdbcType=INTEGER},
#{item.projectCode,jdbcType=VARCHAR}, #{item.projectTitle,jdbcType=VARCHAR},
#{item.projectDate,jdbcType=DATE},
#{item.purchaserUrl,jdbcType=VARCHAR}, #{item.purchaser,jdbcType=VARCHAR},
#{item.updateId,jdbcType=INTEGER},
#{item.updateTime,jdbcType=TIMESTAMP},
#{item.createTime,jdbcType=TIMESTAMP},
#{item.creatorId,jdbcType=INTEGER}, #{item.note,jdbcType=VARCHAR},
#{item.projectPhase,jdbcType=VARCHAR},
#{item.projectPeriodStart,jdbcType=VARCHAR},
#{item.projectPeriodEnd,jdbcType=VARCHAR},
#{item.provinceId,jdbcType=INTEGER},
#{item.projectAddress,jdbcType=VARCHAR},#{item.type,jdbcType=INTEGER},#{item.companyName,jdbcType=VARCHAR},
#{item.amountInvested,jdbcType=DOUBLE},
#{item.projectTitleHash,jdbcType=INTEGER})
</if>
</foreach>
</insert>
英文不好,见谅。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]