Activiti5.6 安装记录

因为工作项目的原因,需要使用 workFlow,经过多方比对最终选择了 Activiti。在网上查询了多个文档后决定进行测试。在 2011年6月1日Activiti发布了5.6提供了对mysql等数据库的全面支持。demo的安装脚本也做的很好,基本上按教程就能顺利demo。为此我将在使用mysql的安装过程及遇到的一些小问题总结记录了下来。
如下是在windows XP环境下使用mysql数据库的安装实录:
一)下载  activiti-5.6
二)将activiti-5.6.zip解压到指定目录,假设为“C:\activiti”,注意下面提到的路径均是相对于该路径而言
三)修改数据库类型为mysql
    打开文件“setup\build.properties”修改db=mysql(默认为h2)。

四)配置mysql数据库
    创建名称为activiti的空数据库,连接帐号设为activiti,密码也设为activiti。(如果不喜欢默认的连接配置,可以修改文件“setup\build.mysql.properties”中相应的属性值)

五)预下载一些必需的文件到“C:\downloads”
    “C:\downloads”这个路径是在build.properties中通过属性“downloads.dir”定义的,也可以手动修改指定其他位置。
   如果确保网络环境很顺畅,这一步也可以不做,安装脚本会自动下载,由于之前的版本我安装时经常下载中断,导致文件损坏、安装异常,所以我习惯了先预先下载,保证安装顺畅点。主要下载如下2个文件,左侧为下载地址,右侧为下载后保存的文件名:
    1)http://mirrors.enquira.co.uk/apache/apache-tomcat-6.0.29.zip --> apache-tomcat-6.0.29.zip  (2.71MB)
    2)http://activiti.org/downloads/activiti-modeler-5.6.war --> activiti-modeler-5.6.war  (31.8MB)


六)检查一下你的电脑是否已经使用了tomcat服务
    如果使用了tomcat服务,得停掉,否测会冲突。顺便检查一下8080端口有没有被占用,否测也会冲突导致安装失败。

八)安装ant1.7和jdk1.5+环境
    主要是设置环境变量ANT_HOME和JAVA_HOME,并将%ANT_HOME%\bin、%JAVA_HOME%\bin设置到path环境变量中。

九)一切就绪后就可以开始体验了
    命令行切换到“setup/",运行"ant demo.start",等待整个安装过程自动完成吧,安装完毕后默认会自动打开浏览器
    

我在安装使用过程中遇到如下一些问题:
1)tomcat控制台显示的中文乱码
    解决办法:修改文件apps\apache-tomcat-6.0.29\conf\logging.properties,增加如下一行的配置:
    java.util.logging.ConsoleHandler.encoding = GBK‘
2)activiti-kickstart 无法正常使用
    解决办法:
          1.拷贝webapps\activiti-rest\WEB-INF\lib\activiti-cfg.jar 到webapps\activiti-kickstart\WEB-INF\lib 下覆盖同名文件。
          2.将mysql-connector-java 的jar包拷贝到webapps\activiti-kickstart\WEB-INF\lib 即可。
   此处在用户文档中都有说明的;看来以后安装前要仔细阅读用户文档,以免走弯路
3)中文显示乱码
      需要修改连接字符串加入:&useUnicode\=true&characterEncoding\=utf-8
4)activiti-administrotor 无法正常使用:
      需要修改activiti-administrator\WEB-INF\applicationContext.xml
      修改示例如下:
      

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
 xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee"
 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
       http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">

 <!-- Turn on annotation based configuration, etc. -->
 <context:property-placeholder location="classpath*:*.properties" />

 <!-- Use annotations to configure our components -->
 <context:component-scan base-package="org.activiti" />

 <!-- Turn on annotations for beans -->
 <context:annotation-config />

 <!-- Configure datasource -->
 <bean id="dataSource" lazy-init="false"
  class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
  <property name="targetDataSource">
   <bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
    <property name="driverClass" value="com.mysql.jdbc.Driver" />
    <property name="url" value="jdbc:mysql://localhost:3306/activiti?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=utf-8" />
    <property name="username" value="root" />
    <property name="password" value="19841115" />
   </bean>
  </property>
 </bean>

 <!-- Configure transaction manager -->
 <bean id="transactionManager" lazy-init="false"
  class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  <property name="dataSource" ref="dataSource" />
 </bean>

 <!-- Use transaction manager annotations -->
 <tx:annotation-driven transaction-manager="transactionManager" />

 <!-- Configure process engine -->
 <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"
  lazy-init="true">
  <property name="databaseType" value="mysql" />
  <property name="dataSource" ref="dataSource" />
  <property name="transactionManager" ref="transactionManager" />
  <property name="databaseSchemaUpdate" value="true" />
  <property name="jobExecutorActivate" value="false" />
 </bean>

 <!-- Use process engine -->
 <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean"
  lazy-init="true">
  <property name="processEngineConfiguration" ref="processEngineConfiguration" />
 </bean>

 <!-- Use process engine service -->
 <bean id="repositoryService" factory-bean="processEngine"
  factory-method="getRepositoryService" lazy-init="true" />
 <bean id="runtimeService" factory-bean="processEngine"
  factory-method="getRuntimeService" lazy-init="true" />
 <bean id="taskService" factory-bean="processEngine"
  factory-method="getTaskService" lazy-init="true" />
 <bean id="historyService" factory-bean="processEngine"
  factory-method="getHistoryService" lazy-init="true" />
 <bean id="managementService" factory-bean="processEngine"
  factory-method="getManagementService" lazy-init="true" />
 <bean id="identityService" factory-bean="processEngine"
  factory-method="getIdentityService" lazy-init="true" />

</beans>

 

到此各项功能均能正常使用

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值