频道直达 - 专题 - 新闻 - 技巧 - 组网 - 开发 - 安全 - web编程 - 图像 - 操作系统 - 数据库 - 教育 - 旅游 - 健康 - 时尚 - 驱动 - 软件 - 游戏 - 多媒体 - ERP - 讨论组

spring+hibernate+jbpm整合成功

来源: 作者: 出处:巧巧读书 2006-11-15 进入讨论组

终于搞定了,在此感谢chenjin的指点。

从10.31日整合失败后,这块就一直是我的心病,我甚至都跑去了http://www.springframework.org/去发了一个帖,这还是我第一次用英文问问题呢。

最后的配置结果是:

hibernate.cfg.xml、jbpm.cfg.xml在关联spring后保持不变,只需要更改spirng的配置文件就好了。


spring+hibernate+jbpm整合成功<?xml version="1.0" encoding="UTF-8"?>
spring+hibernate+jbpm整合成功<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
spring+hibernate+jbpm整合成功"http://www.springframework.org/dtd/spring-beans.dtd">
spring+hibernate+jbpm整合成功<beans>
spring+hibernate+jbpm整合成功    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
spring+hibernate+jbpm整合成功        <property name="driverClassName">
spring+hibernate+jbpm整合成功            <value>com.mysql.jdbc.Driver</value>
spring+hibernate+jbpm整合成功        </property>
spring+hibernate+jbpm整合成功        <property name="url">
spring+hibernate+jbpm整合成功            <value>jdbc:mysql://localhost:3306/test</value>
spring+hibernate+jbpm整合成功        </property>
spring+hibernate+jbpm整合成功        <property name="username">
spring+hibernate+jbpm整合成功            <value>root</value>
spring+hibernate+jbpm整合成功        </property>
spring+hibernate+jbpm整合成功        <property name="password">
spring+hibernate+jbpm整合成功            <value/>
spring+hibernate+jbpm整合成功        </property>
spring+hibernate+jbpm整合成功    </bean>
spring+hibernate+jbpm整合成功    <!-- Hibernate SessionFactory -->
spring+hibernate+jbpm整合成功    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
spring+hibernate+jbpm整合成功        <property name="dataSource">
spring+hibernate+jbpm整合成功            <ref local="dataSource"/>
spring+hibernate+jbpm整合成功        </property>
spring+hibernate+jbpm整合成功        <property name="mappingLocations">  
spring+hibernate+jbpm整合成功           <value>classpath*:/org/jbpm/**/*.hbm.xml</value>  
spring+hibernate+jbpm整合成功           </property>
spring+hibernate+jbpm整合成功        <property name="hibernateProperties">  
spring+hibernate+jbpm整合成功           <props>  
spring+hibernate+jbpm整合成功               <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
spring+hibernate+jbpm整合成功               <prop key="hibernate.hbm2ddl.auto">update</prop>
spring+hibernate+jbpm整合成功               <prop key="hibernate.jdbc.batch_size">0</prop>
spring+hibernate+jbpm整合成功           </props>
spring+hibernate+jbpm整合成功       </property> 
spring+hibernate+jbpm整合成功    </bean>
spring+hibernate+jbpm整合成功    <!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
spring+hibernate+jbpm整合成功    <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
spring+hibernate+jbpm整合成功        <property name="sessionFactory">
spring+hibernate+jbpm整合成功            <ref local="sessionFactory"/>
spring+hibernate+jbpm整合成功        </property>
spring+hibernate+jbpm整合成功    </bean>
spring+hibernate+jbpm整合成功    
spring+hibernate+jbpm整合成功    <!-- reading jBPM process definitions -->
spring+hibernate+jbpm整合成功    <bean id="websaleWorkflow1" class="org.springmodules.workflow.jbpm31.definition.ProcessDefinitionFactoryBean">
spring+hibernate+jbpm整合成功        <property name="definitionLocation"    value="processdefinition.xml"/>
spring+hibernate+jbpm整合成功    </bean>
spring+hibernate+jbpm整合成功    <!-- jBPM configuration--> 
spring+hibernate+jbpm整合成功    <bean id="jbpmConfiguration" class="org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean">
spring+hibernate+jbpm整合成功        <property name="sessionFactory" ref="sessionFactory"/>
spring+hibernate+jbpm整合成功        <property name="configuration" value="jbpm.cfg.xml"/>
spring+hibernate+jbpm整合成功        <property name="processDefinitions">
spring+hibernate+jbpm整合成功            <list>
spring+hibernate+jbpm整合成功                <ref local="websaleWorkflow1"/>
spring+hibernate+jbpm整合成功            </list>
spring+hibernate+jbpm整合成功        </property>
spring+hibernate+jbpm整合成功        <property name="createSchema" value="true"/>
spring+hibernate+jbpm整合成功    </bean>
spring+hibernate+jbpm整合成功    <!-- jBPM template -->
spring+hibernate+jbpm整合成功    <bean id="jbpmTemplate" class="org.springmodules.workflow.jbpm31.JbpmTemplate">
spring+hibernate+jbpm整合成功        <constructor-arg index="0" ref="jbpmConfiguration"/>
spring+hibernate+jbpm整合成功        <constructor-arg index="1" ref="websaleWorkflow1"/>
spring+hibernate+jbpm整合成功    </bean>
spring+hibernate+jbpm整合成功
spring+hibernate+jbpm整合成功</beans>
spring+hibernate+jbpm整合成功

 

其中

spring+hibernate+jbpm整合成功<property name="mappingLocations">  
spring+hibernate+jbpm整合成功           <value>classpath*:/org/jbpm/**/*.hbm.xml</value>  
spring+hibernate+jbpm整合成功           </property>

很关键,我就是想spring会通过jbpm找到hibernate.cfg.xml而没有设置,才失败的。

更多文章 更多内容请看Spring开源框架技术Hibernate原理与配置Spring开发技术篇专题,或进入讨论组讨论。
更多专题 【深 度 阅 读】 相 关 文 章
    收藏此文】【 】【打印】【关闭
    相关图文阅读
    频道图文推荐
    健 康 咨 询
    时 尚 咨 询
    巧巧读书宗旨
    相关专题
    讨论组问题推荐
    站内各频道最新更新文档
    站内最新制作专题
    热门关键字导读
    Photoshop教 程照片处理 照片制作 PS快捷键 抠图
    计 算 机 故 障XP系统修复
    艺 术 与 设 计设计 流媒体 设计欣赏 边框
    计 算 机 安 全ARP
    站内频道文章精选
    巧巧电脑频道编辑信箱  告诉我们您想看的专题或文章