posts - 193,  comments - 520,  trackbacks - 0

1. 从 http://www.jboss.com/products/jbpm/downloads 下载 jbpm-3.0.zip

2. 解压缩 jbpm-3.0.zip 到 'temp' 目录

3. 使用 eclipse, 将 'temp\jbpm-3.0' 作为 an existing project into workspace 导入

配置连接 MySQL

1. 在 'jbpm-3.0\lib' 目录下 创建 'mysql' 目录

2. 将 mysql数据库驱动 (mysql-connector-java-3.1.7-bin.jar) 拷贝到 'mysql' 目录

3. 在 mysql 中创建一个数据库,数据库名字

4. 在 'jbpm-3.0\src\resources'目录下创建 'mysql' 目录

5. 把两个配置文件 (create.db.hibernate.properties, identity.db.xml) 从 'hsqldb' 目录下 拷贝到 'mysql' 目录

6. 按下面所示编辑 'create.db.hibernate.properties' 文件: hibernate.dialect=org.hibernate.dialect.MySQLDialect

hibernate.connection.driver_class=com.mysql.jdbc.Driver

hibernate.connection.url=jdbc:mysql://localhost:3306/

hibernate.connection.username= hibernate.connection.password=

hibernate.show_sql=true hibernate.query.substitutions=true 1, false 0

hibernate.c3p0.min_size=1 hibernate.c3p0.max_size=3

7. 另一个文件 'identity.db.xml'不做改动

8. 在 'jbpm-3.0' 根目录, 编辑ANT的脚本 'build.deploy.xml' 找到 target name="create.db", 删除 db.start, db.stop 在这个目标块中将所有的'hsqldb' 替换为 'mysql'

9. 运行ANT ant create.db -buildfile build.deploy.xml 运行完毕后就会发现mysql中多出很多表,这是jbpm保持状态用的

创建 jbpm.war 使其在tomcat中运行

默认的打war包时,掉了一些库文件

1. 在 eclipse中, 编辑ant脚本 'build.deploy.xml' 在目标块 target name="build.webapp" 中在

<copy todir="build/jbpm.war.dir/WEB-INF/lib"> 下将

<fileset dir="build" includes="jbpm-webapp-${jbpm.version}.jar" /> 替换为

<fileset dir="build" includes="jbpm*.jar" />

 另外加入新的两行

<fileset dir="lib/hibernate" includes="*.jar" />
<fileset dir="lib/bsh" includes="*.jar" />

2.因为 Hibernate 不能将它的SessionFactory与tomcat的jndi 绑定 , 我们直接在源码中修改

3. 打开源文件 JbpmSessionFactory.java, 在 getInstance() 方法里, 删除下面代码

InitialContext initialContext = new InitialContext(); Object o = initialContext.lookup(jndiName);

将下面这行

instance = (JbpmSessionFactory) PortableRemoteObject.narrow
(o, JbpmSessionFactory.class);

替换为 instance = (JbpmSessionFactory) PortableRemoteObject.narrow
(new JbpmSessionFactory(createConfiguration()), JbpmSessionFactory.class);

4.在 createConfiguration(String configResource) 方法里, 注释掉这段代码

String hibernatePropertiesResource = JbpmConfiguration.getString("jbpm.hibernate.properties");

if (hibernatePropertiesResource!=null) { Properties hibernateProperties =
new Properties();

try { hibernateProperties.load( ClassLoaderUtil.getStream(hibernatePropertiesResource) ); }

catch (IOException e) {
      e.printStackTrace();
      throw new RuntimeException
   ("couldn't load the hibernate properties from resource      '"hibernatePropertiesResource"'", e);
}
log.debug("overriding hibernate properties with "+ hibernateProperties); configuration.setProperties(hibernateProperties);
}
同时加入下面的代码

configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");

configuration.setProperty("hibernate.connection.driver_class", "com.mysql.jdbc.Driver");

configuration.setProperty("hibernate.connection.url", "jdbc:mysql://localhost:3306/";);

configuration.setProperty("hibernate.connection.username", "");

configuration.setProperty("hibernate.connection.password", "");

configuration.setProperty("hibernate.connection.pool_size", "15");

5. 运行脚本命令 ant build ant build.webapp -buildfile build.deploy.xml

6. 将jbpm.war 从 'jbpm-3.0\build' 下拷贝到 'tomcat.home\webapps'

7. 启动 tomcat

8. 打开浏览器 'http://localhost:8080/jbpm'



http://www.blogjava.net/ronghao 荣浩原创,转载请注明出处:)
posted on 2005-11-10 17:31 ronghao 阅读(3394) 评论(5)  编辑  收藏 所属分类: 工作日志

FeedBack:
# re: 在Tomcat中配置运行jbpm自带的websale
2005-11-16 14:51 | 孙茂成
我的公司msn:smc@rjgrid.com.cn
私人msn:thunderbird.smc@homtamil.com
我的信箱:thunderbird.smc@gmail.com

很高兴看到你的博客,我正在读jbpm源码手上也有个比较大的项目,希望能和你交流
  回复  更多评论
  
# re: 在Tomcat中配置运行jbpm自带的websale
2005-11-16 18:04 | ronghao
我也是刚刚对jbpm看了看源码,还没在实际项目中运用过,多交流吧  回复  更多评论
  
# re: 在Tomcat中配置运行jbpm自带的websale
2005-11-18 17:37 | 路人甲
首先十分大哥的这篇文章,小弟是刚刚接触工作流,很多地方都不懂,看完这篇文章后实在受益非浅.
另我在实际操作中有几处与上文有出入
hibernate.connection.url=jdbc:mysql://localhost:3306/jbpmtest
这里不指定database的话好像会找不到数据库吧?
configuration.setProperty("hibernate.connection.url", "jdbc:mysql://localhost:3306/jbpmtest");
configuration.setProperty("hibernate.connection.username", "root");
<fileset dir="lib/mysql" includes="*.jar" />
数据库驱动



  回复  更多评论
  
# re: 在Tomcat中配置运行jbpm自带的websale
2006-04-06 17:53 | dawn
我按照上边的方法打好war后发布时jsp页面显示,requested resource is not available。
而且当把jbpm.war copy到webapps目录下后,启动tomcat时会报好长的错:严重parse Error …… Document is in invalid: no grammer found. org.xml.sax.SAXParseException。

请问这是怎么回事呢?  回复  更多评论
  
# re: 在Tomcat中配置运行jbpm自带的websale
2006-08-17 09:17 | hou
我按要求把jbpm放在tomcat下运行时产生错误,严重Error ListenerStart,
在build.properties配置好Jboss之后,运行jbpm-server下的start.bat不出错,就是有的时候数据库的表没了,怎么回事?
msn:houzz_101@hotmail.com  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航:
 
<2005年11月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

关注工作流和企业业务流程改进。现就职于ThoughtWorks。新浪微博:http://weibo.com/ronghao100

常用链接

留言簿(38)

随笔分类

随笔档案

文章分类

文章档案

常去的网站

搜索

  •  

最新评论

阅读排行榜

评论排行榜