Hello: Who did solve this problem before?Can I add some properties to fix this.
<environment id="development"> <transactionManager type="JDBC"/> <dataSource type="POOLED"> <property name="driver" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql:// 192.168.0.110:3306/bulkupload?autoReconnect=true" /> <property name="username" value="freebird"/> <property name="password" value="770328"/> <property name="poolPingQuery" value="select * from jobstatus"/> <property name="poolPingEnabled" value="true"/> </dataSource> </environment> 陈抒 Best regards http://blog.csdn.net/sheismylife On Wed, May 12, 2010 at 9:31 AM, 陈抒 <csfreeb...@gmail.com> wrote: > After adding ?autoReconnect=true,I got the following error message. > > > [Level:ERROR] [Time:2010-05-10 22:30:27,103] [Thread: pool-1-thread-1] > [Class:PortageService] [Method:?] [Line:?] > Throwable in ResultFileHandler.run: > ### Error updating database. Cause: java.lang.NullPointerException > ### The error may exist in iBATIS3/Xml/user.map.xml > ### The error may involve iBATIS3.Xml.UserMapper.addMailRequest > ### The error occurred while executing an update > ### Cause: java.lang.NullPointerException > org.apache.ibatis.exceptions.IbatisException: > ### Error updating database. Cause: java.lang.NullPointerException > ### The error may exist in iBATIS3/Xml/user.map.xml > ### The error may involve iBATIS3.Xml.UserMapper.addMailRequest > ### The error occurred while executing an update > ### Cause: java.lang.NullPointerException > at > org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8) > at > org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:100) > at > org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:87) > at > freebird.business.MailManager.addMailRequest(MailManager.java:18) > at > freebird.helper.MailHelper.sendMailRequestToUser(MailHelper.java:68) > at > com.exactor.cn.portageservice.ResultFileHandler.handleCorrectResultFile(ResultFileHandler.java:99) > at > com.exactor.cn.portageservice.ResultFileHandler.run(ResultFileHandler.java:123) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > Caused by: java.lang.NullPointerException > at freebird.business.Email.getReceiverList(Email.java:105) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > org.apache.ibatis.reflection.invoker.MethodInvoker.invoke(MethodInvoker.java:22) > at > org.apache.ibatis.reflection.wrapper.BeanWrapper.getBeanProperty(BeanWrapper.java:133) > at > org.apache.ibatis.reflection.wrapper.BeanWrapper.get(BeanWrapper.java:27) > at > org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:103) > at > org.apache.ibatis.builder.xml.dynamic.DynamicContext.<init>(DynamicContext.java:29) > at > org.apache.ibatis.builder.xml.dynamic.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:21) > at > org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:198) > at > org.apache.ibatis.executor.statement.BaseStatementHandler.<init>(BaseStatementHandler.java:45) > at > org.apache.ibatis.executor.statement.PreparedStatementHandler.<init>(PreparedStatementHandler.java:16) > at > org.apache.ibatis.executor.statement.RoutingStatementHandler.<init>(RoutingStatementHandler.java:27) > at > org.apache.ibatis.session.Configuration.newStatementHandler(Configuration.java:226) > at > org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:27) > at > org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:72) > at > org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:43) > at > org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:98) > ... 8 more > > > 陈抒 > Best regards > http://blog.csdn.net/sheismylife > > > On Mon, May 10, 2010 at 12:03 AM, Martin Ellis <mar...@ellis.name> wrote: > >> On 9 May 2010 07:43, 陈抒 <csfreeb...@gmail.com> wrote: >> > You should consider either expiring and/or testing >> > connection validity before use in your application, increasing the >> server >> > configured values for client timeouts, or using the Connector/J >> connection >> > property 'autoReconnect=true' to avoid this problem. >> >> The error message you've posted lists three ways to correct the problem. >> >> The third is probably the easiest to try, it's a one line change: just add >> ?autoReconnect=true to your JDBC URI. >> >> Martin >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org >> For additional commands, e-mail: user-java-h...@ibatis.apache.org >> >> >