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"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <!-- 自动扫描与装配bean -->
<context:component-scan base-package="cn.itcast.oa"></context:component-scan> <!-- 导入外部的properties配置文件 -->
<context:property-placeholder location="classpath:jdbc.properties" /> <!-- 配置数据库连接池 -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<!-- =========== 数据库连接信息 =========== -->
<property name="jdbcUrl" value="${jdbcUrl}"></property>
<property name="driverClass" value="${driverClass}"></property>
<property name="user" value="${username}"></property>
<property name="password" value="${password}"></property>
<!-- =========== 连接池的管理配置 =========== -->
<!--初始化时获取三个连接,取值应在minPoolSize与maxPoolSize之间。Default: 3 -->
<property name="initialPoolSize" value="3"></property>
<!--连接池中保留的最小连接数。Default: 3 -->
<property name="minPoolSize" value="3"></property>
<!--连接池中保留的最大连接数。Default: 15 -->
<property name="maxPoolSize" value="5"></property>
<!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 -->
<property name="acquireIncrement" value="3"></property>
<!--
控制数据源内加载的PreparedStatements数量。如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default:
0
-->
<property name="maxStatements" value="8"></property>
<!--
maxStatementsPerConnection定义了连接池内单个连接所拥有的最大缓存statements数。Default: 0
-->
<property name="maxStatementsPerConnection" value="5"></property>
<!--最大空闲时间,1800秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 -->
<property name="maxIdleTime" value="1800"></property>
</bean> <!-- 配置SessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="configLocation" value="classpath:hibernate.cfg.xml"></property>
</bean> <!-- 配置声明式的事务管理(采用基于注解的方式) -->
<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<tx:annotation-driven transaction-manager="txManager" /> <!-- 配置JBPM的ProcessEngine,注意配置文件的路径要写正确! -->
<bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper">
<property name="jbpmCfg" value="jbpm.cfg.xml"></property>
</bean>
<bean id="processEngine" factory-bean="springHelper" factory-method="createProcessEngine" /> </beans>

  hibernate.cfg.xml

<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration>
<session-factory> <!-- 数据连接信息
<property name="hibernate.connection.url">jdbc:mysql:///itcastoa</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">1234</property>
--> <property name="hibernate.dialect">
org.hibernate.dialect.MySQL5InnoDBDialect
</property> <!-- 其他配置信息 -->
<property name="show_sql">true</property>
<property name="hbm2ddl.auto">update</property> <!-- 这些映射文件是JBPM的,不能删除!!! -->
<mapping resource="jbpm.repository.hbm.xml" />
<mapping resource="jbpm.execution.hbm.xml" />
<mapping resource="jbpm.history.hbm.xml" />
<mapping resource="jbpm.task.hbm.xml" />
<mapping resource="jbpm.identity.hbm.xml" /> <!-- 声明映射文件 -->
<mapping resource="cn/itcast/oa/domain/User.hbm.xml" />
<mapping resource="cn/itcast/oa/domain/Role.hbm.xml" />
<mapping resource="cn/itcast/oa/domain/Department.hbm.xml" />
<mapping resource="cn/itcast/oa/domain/Privilege.hbm.xml" />
<mapping resource="cn/itcast/oa/domain/Forum.hbm.xml" />
<mapping resource="cn/itcast/oa/domain/Reply.hbm.xml" />
<mapping resource="cn/itcast/oa/domain/Topic.hbm.xml" />
<mapping resource="cn/itcast/oa/domain/Template.hbm.xml" /> </session-factory>
</hibernate-configuration>

删除:src/jbpm.hibernate.cfg.xml  

jbpm.cfg.xml

<?xml version="1.0" encoding="UTF-8"?>

<jbpm-configuration>

	<import resource="jbpm.default.cfg.xml" />
<import resource="jbpm.businesscalendar.cfg.xml" /> <!-- 删除此项配置
<import resource="jbpm.tx.hibernate.cfg.xml" />
--> <!-- 导入jbpm.tx.spring.cfg.xml文件 -->
<import resource="jbpm.tx.spring.cfg.xml" /> <import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.bpmn.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" /> <!-- Job executor is excluded for running the example test cases. -->
<!--
To enable timers and messages in production use, this should be
included.
-->
<!--
<import resource="jbpm.jobexecutor.cfg.xml" />
--> </jbpm-configuration>

  测试:

	@Test
public void testProcessEngine() throws Exception {
ProcessEngine processEngine = (ProcessEngine) ac.getBean("processEngine");
System.out.println(processEngine);
}

  业务层获取ProcessEngine方式:

@Resource

private ProcessEngine processEngine

注意:如果启动程序的时候包错的内容是关于el表达式错误信息

处理方式:

  里面不包含jbpm的juel-api.jar juel-engine.jar juel-impl.jar这三个jar包 ,因为这三个jar包自带的el表达式需要的jar包 而且版本比tomcat里面自带的lib包的el.jar版本高,所有应该删除jbpm的这三个jar包 拷贝到tomcat的lib包下

jbpm与spring hibernate struts整合的更多相关文章

  1. spring+hibernate+struts整合(1)

    spring+hibernate:整合 步骤1:引入类包 如下图:这里是所有的类包,为后面的struts整合考虑

  2. spring+hibernate+struts整合(2)

    spring和struts2的整合 1:配置Web.xml文件 <filter> <filter-name>struts2</filter-name> <fi ...

  3. Spring+Hibernate+Struts(SSH)框架整合

    SSH框架整合 前言:有人说,现在还是流行主流框架,SSM都出来很久了,更不要说SSH.我不以为然.现在许多公司所用的老项目还是ssh,如果改成流行框架,需要成本.比如金融IT这一块,数据库dao层还 ...

  4. Struts+Spring+Hibernate项目整合AJAX+JSON

    1.什么是AJAX AJAX是 "Asynchronous JavaScript and XML" 的简称,即异步的JavaScript和XML. 所谓异步,就是提交一个请求不必等 ...

  5. Spring与Struts整合

    Spring框架是一个非常优秀的轻量级Java EE容器,Spring框架是整个轻量级Java EE框架的核心.大部分的Java EE应用,都会考虑使用Spring容器管理应用中的组件,从而保证各组件 ...

  6. spring 和 struts 整合遇到的问题(学习中)

    一大早就报错 org.hibernate.TransactionException: Transaction not successfully started at org.hibernate.eng ...

  7. spring和struts整合

    整合准备:导入jar包 如果只是访问action,没有做数据库方面的操作的话 只需要导入下面的jar spring相关jar 以及struts相关jar包 整合过程: 用到了struts所以需要在we ...

  8. Spring,hibernate,struts的面试笔试题(含答案)

    Hibernate工作原理及为什么要用? 原理: 1.读取并解析配置文件 2.读取并解析映射信息,创建SessionFactory 3.打开Sesssion 4.创建事务Transation 5.持久 ...

  9. Struts2 Spring Hibernate 框架整合 Annotation MavenProject

    项目结构目录 pom.xml       添加和管理jar包 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns ...

随机推荐

  1. Ubuntu14.04建立WiFi热点

    整理自Ubuntu 下建立WiFi热点的方法 Ubuntu14.04 Deepin2014分享WiFi 亲测成功 方法一:network manager 用Ubuntu自带的network manag ...

  2. 李洪强iOS开发之-PCH文件的配置

    pch 可以用来存储共享信息,比如设备屏幕的宽度,高度.版本号等等 公用信息 Xcode 老版本会自动为我们创建pch文件,新版本开始不自动创建了,如果需要使用可以自己手动创建 创建完成后可以在里面定 ...

  3. C# Eval在asp.net中的用法及作用

    Eval( " ")和Bind( " ") 这两种一个单向绑定,一个双向绑定,bind是双向绑定,但需数据源支持 ASP.NET 2.0改善了模板中的数据绑定操 ...

  4. 徐汉彬:Web系统大规模并发——电商秒杀与抢购

    [导读]徐汉彬曾在阿里巴巴和腾讯从事4年多的技术研发工作,负责过日请求量过亿的Web系统升级与重构,目前在小满科技创业,从事SaaS服务技术建设. 电商的秒杀和抢购,对我们来说,都不是一个陌生的东西. ...

  5. Handler 接收Parcelable ArrayList时返回空的错误

    遇到一个问题,从handler 接收的Parcelable ArrayList返回空,调试发现这个arraylist生成的时候是有值的,传到handler就没值了 赋值的代码 new Thread(n ...

  6. Form - CHECKBOX全选功能

    FORM BUILDER开发,遇到这样一个需求: 添加一个CHECKBOX完成全选功能,红框为新添加的CHECKBOX(如图示) Try to use APP_RECORD.FOR_ALL_RECOR ...

  7. STL 优先队列

    STL 栈,队列,优先队列用法 分类: Learning C++2013-11-15 00:52 843人阅读 评论(2) 收藏 举报 c++栈队列优先队列STL STL 中栈的使用方法(stack) ...

  8. USACO4.13Fence Loops(无向图最小环)

    最近脑子有点乱 老是不想清楚就啪啪的敲 敲完之后一看 咦..样例都过不去 仔细一想 这样不对啊 刚开始就写了一SPFA 最后发现边跟点的关系没处理好 删了..写dfs..还是没转化好 开始搜解题方法 ...

  9. c#反射重载方法(发现不明确的匹配)

    GetMethod(string name) 在反射重载方法时,如果调用此重载方法,会产生 发现不明确的匹配 的错误. 解决方案如下: GetMethod("MethodName" ...

  10. maven常用技巧

    安装Maven后我们会在用户目录下发现.m2 文件夹.默认情况下,该文件夹下放置了Maven本地仓库.m2/repository.所有的Maven构件(artifact)都被存储到该仓库中,以方便重用 ...