zoukankan      html  css  js  c++  java
  • 又纠结activiti

    接触一门技术当然是先看getting start,可不得不吐槽activiti的官方的入门手册真是坑,多的不说,看这个兄台的吐槽吧http://blog.csdn.net/snsn1984/article/details/40261913

    然后是遇到的问题和自己琢磨的解决办法

    1. 5.17是我目前看到官网上最新的版本,但是公司用的Jdk1.6+tomcat6,该5.17版本貌似需要tomcat7才能正常发布那两个war,所以回退5.16了
    2. 开始莫名其妙遇到数据库连接乱码,后台强行把jdbc改成这样就没事了(为什么说强行,因为很多示例都没有这么加)
      jdbc:mysql://localhost:3306/activiti?useUnicode=true;characterEncoding=utf-8
    3. 按照http://my.oschina.net/Barudisshu/blog/309721这位大神的代码,写出来的东西在公司电脑能正常运行,但是在我自己电脑上会报错,报错信息如下

    ***************笔试流程开始***************
    Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:
    ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'order by RES.ID_ asc
    LIMIT 2147483647 OFFSET 0' at line 30
    ### 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 distinct RES.* from ACT_RU_TASK RES inner join ACT_RU_IDENTITYLINK I on I.TASK_ID_ = RES.ID_ WHERE RES.ASSIGNEE_ is null and I.TYPE_ = 'candidate' and ( I.GROUP_ID_ IN ( ? ) ) order by order by RES.ID_ asc LIMIT ? OFFSET ?
    ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'order by RES.ID_ asc
    LIMIT 2147483647 OFFSET 0' at line 30
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:122)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:113)
    at org.activiti.engine.impl.db.DbSqlSession.selectListWithRawParameter(DbSqlSession.java:423)
    at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:414)
    at org.activiti.engine.impl.persistence.entity.TaskEntityManager.findTasksByQueryCriteria(TaskEntityManager.java:121)
    at org.activiti.engine.impl.TaskQueryImpl.executeList(TaskQueryImpl.java:1143)
    at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:158)
    at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
    at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
    at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
    at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
    at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
    at org.activiti.engine.impl.AbstractQuery.list(AbstractQuery.java:132)
    at activiti.test.Test.main(Test.java:25)
    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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
    Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'order by RES.ID_ asc
    LIMIT 2147483647 OFFSET 0' at line 30
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.Util.getInstance(Util.java:386)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2825)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2156)
    at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1379)
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:62)
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:78)
    at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62)
    at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:303)
    at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:154)
    at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:102)
    at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:82)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:120)
    ... 18 more

    暂时还不知道怎么解决这个问题,于是只能在公司电脑上做了,不在自己电脑搞了。(公司电脑mysql5.1,我自己的是mysql5.5,按理说要错也是公司的电脑报错才对)

    好吧,问题解决了。网上没找到解决办法,但是估计是大家都是直接从官网把war包发布之后直接从web-inf下面把全部的jar包拷进去,所以不会错。我却乖乖的只要官网给的zip包里面的Lib,然后缺什么找什么,比如hibernate、ibatis、spring这些都是自己找的,结果jar包版本错漏,导致出现这个问题。总结一下就是,要懂偷懒,有得拷就不要自己找最新版。

  • 相关阅读:
    你还在钟情于windows XP吗?
    我常用的vim快捷键
    2013年读的书(很多还没看完)
    期末考试了
    顺着自己的心,去做自己喜欢的事
    关于最近新闻泛滥的几点看法以及学习的个人观点
    华为OJ_1
    【Android】弹出软键盘时候让上面布局跟着上移的方法
    【Android】策略模式封装百度地图路线规划模块
    google觉得好用的插件(不断更新)
  • 原文地址:https://www.cnblogs.com/javaxiu/p/4673467.html
Copyright © 2011-2022 走看看