Activiti5.19查询报错[java.sql.SQLSyntaxErrorException: ORA-00936: 缺失表达式]

一.问题

今天用activiti新做一个项目,直接复制之前的代码,然后建数据库,随手把Spring,Spring MVC和Mybatis等版本升级了一下,问题就出现了.

所有activiti自带的查询都无法使用,全部报错如下

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: ORA-00936: 缺失表达式

### The error may exist in org/activiti/db/mapping/entity/Task.xml
### The error may involve org.activiti.engine.impl.persistence.entity.TaskEntity.selectTaskByQueryCriteria-Inline
### The error occurred while setting parameters
### SQL: select * from ( select a.*, ROWNUM rnum from (     select distinct RES.*              from ACT_RU_TASK RES                                          inner join ACT_RE_PROCDEF D on RES.PROC_DEF_ID_ = D.ID_                        WHERE  RES.ASSIGNEE_ = ?                                                                                                                                                                                   and D.KEY_ = ?                                                                                                                                                                         and RES.SUSPENSION_STATE_ = 1                order by  order by RES.ID_ desc, RES.CREATE_TIME_ desc         ) a where ROWNUM < ?) where rnum  >= ?
### Cause: java.sql.SQLSyntaxErrorException: ORA-00936: 缺失表达式

    org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:981)
    org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
    org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

简单查看SQL问题应该在order by后面没有字段,但是所有查询都是这个报错就不应该了,找了好久都没发现那里出了问题

二.解决

想了半天终于想起来了,之前的项目用的mybatis是3.2.6版本的,在这个项目里升级到3.3.0版本,问题可能出在这里
赶紧回滚到3.2.6版本,果然就解决了….真是坑爹

你可能感兴趣的:(Java,IDEA,Activiti)