点击审批后报错

来源:8-6 完整实现请假审批

warren_au

2020-07-28 17:18:33

报错信息:

[http-nio-80-exec-6] DEBUG o.a.i.t.jdbc.JdbcTransaction - Opening JDBC Connection

[http-nio-80-exec-6] DEBUG o.a.i.t.jdbc.JdbcTransaction - Setting autocommit to false on JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@5badb465]

[http-nio-80-exec-6] DEBUG c.w.o.d.P.selectByFormId - ==>  Preparing: select * from adm_process_flow where form_id=? order by order_no 

[http-nio-80-exec-6] DEBUG c.w.o.d.P.selectByFormId - ==> Parameters: 31(Long)

[http-nio-80-exec-6] DEBUG c.w.o.d.P.selectByFormId - <==      Total: 3

[http-nio-80-exec-6] DEBUG com.wjb.oa.dao.ProcessFlowDao.update - ==>  Preparing: UPDATE adm_process_flow SET form_id = ?, operator_id = ?, action = ?, result = ?, reason = ?, create_time = ?, audit_time = ?, order_no = ?, state = ?, is_last = ? WHERE process_id = ? 

[http-nio-80-exec-6] DEBUG com.wjb.oa.dao.ProcessFlowDao.update - ==> Parameters: 31(Long), 2(Long), audit(String), approved(String), (String), 2020-03-28 14:49:09.0(Timestamp), 2020-07-28 19:17:52.868(Timestamp), 2(Integer), complete(String), 0(Integer), 75(Long)

[http-nio-80-exec-6] DEBUG com.wjb.oa.dao.ProcessFlowDao.update - <==    Updates: 1

[http-nio-80-exec-6] DEBUG c.wjb.oa.dao.LeaveFormDao.selectById - ==>  Preparing: select * form adm_leave_form where form_id=? 

[http-nio-80-exec-6] DEBUG c.wjb.oa.dao.LeaveFormDao.selectById - ==> Parameters: 31(Long)

[http-nio-80-exec-6] DEBUG o.a.i.t.jdbc.JdbcTransaction - Rolling back JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@5badb465]

[http-nio-80-exec-6] DEBUG o.a.i.t.jdbc.JdbcTransaction - Resetting autocommit to true on JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@5badb465]

[http-nio-80-exec-6] DEBUG o.a.i.t.jdbc.JdbcTransaction - Closing JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@5badb465]

[http-nio-80-exec-6] ERROR c.wjb.oa.controller.LeaveFormServlet - ???????

org.apache.ibatis.exceptions.PersistenceException: 

### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'form adm_leave_form where form_id=31' at line 1

### The error may exist in mappers/leave_form.xml

### The error may involve com.wjb.oa.dao.LeaveFormDao.selectById-Inline

### The error occurred while setting parameters

### SQL: select * form adm_leave_form where form_id=?

### Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'form adm_leave_form where form_id=31' at line 1

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:76)

at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:87)

at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)

at com.sun.proxy.$Proxy10.selectById(Unknown Source)

at com.wjb.oa.service.LeaveFormService.lambda$audit$4(LeaveFormService.java:136)

at com.wjb.oa.utils.MybatisUtils.excuteUpdate(MybatisUtils.java:38)

at com.wjb.oa.service.LeaveFormService.audit(LeaveFormService.java:114)

at com.wjb.oa.controller.LeaveFormServlet.audit(LeaveFormServlet.java:94)

at com.wjb.oa.controller.LeaveFormServlet.doPost(LeaveFormServlet.java:38)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)

at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)

at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:615)

at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)

at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1627)

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:748)

Caused by: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'form adm_leave_form where form_id=31' at line 1

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)

at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)

at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)

at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:370)

at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497)

at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)

at com.sun.proxy.$Proxy6.execute(Unknown Source)

at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)

at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)

at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)

at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)

at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)

at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)

at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)

... 34 common frames omitted


写回答

1回答

好帮手慕阿慧

2020-07-28

同学你好,根据错误信息 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'form adm_leave_form where form_id=31'

是sql语句错误。form adm_leave_form中form拼写错误,应该是from

祝学习愉快~

0

0 学习 · 16556 问题

查看课程