锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品日韩一区二区三区,色综合综合网,亚洲精品中文字http://www.aygfsteel.com/fantasyginge/category/6929.htmlzh-cnFri, 02 Mar 2007 03:32:52 GMTFri, 02 Mar 2007 03:32:52 GMT60jBPM 寮冪敤jndi DataSourcehttp://www.aygfsteel.com/fantasyginge/articles/27674.htmlfantasygingefantasygingeThu, 12 Jan 2006 02:23:00 GMThttp://www.aygfsteel.com/fantasyginge/articles/27674.htmlhttp://www.aygfsteel.com/fantasyginge/comments/27674.htmlhttp://www.aygfsteel.com/fantasyginge/articles/27674.html#Feedback0http://www.aygfsteel.com/fantasyginge/comments/commentRss/27674.htmlhttp://www.aygfsteel.com/fantasyginge/services/trackbacks/27674.html
   鏄ㄥぉ鑳℃悶浜嗕竴澶╋紝铏界劧寮勫ソ浜唈BPM鐨勬暟鎹簱璁劇疆錛屼絾鏄粡榪囨槰鏅氬洖鍘繪煡鐪婬elp 鍏充簬deployment鐨勬枃妗e拰鐩稿叧鐨勬簮鐮侊紝緇堜簬寮勫嚭鏈綆鍗曠殑鏂規(guī)硶銆?BR>

Help Deployment涓叧浜巎bpm.properties

Following properties can be specified in the jbpm.properties configuration file

Table 5.2. 

Property Default Value Description
jbpm.session.factory.jndi.name   if specified, the JbpmSessionFactory.getInstance() method will fetch the singleton instance from the given JNDI location. Otherwise a new JbpmSessionFactory will be created upon initialization of the singleton instance.


婧愮爜涓殑榪欎釜JbpmSessionFactory.java綾諱腑
 public static JbpmSessionFactory getInstance() {
    if (instance==null) {
     
      // if there is a JNDI name configured
      if (jndiName!=null) {
        try {
          // fetch the JbpmSessionFactory from JNDI
          log.debug("fetching JbpmSessionFactory from '"+jndiName+"'");
          InitialContext initialContext = new InitialContext();
          Object o = initialContext.lookup(jndiName);
          instance = (JbpmSessionFactory) PortableRemoteObject.narrow(o, JbpmSessionFactory.class);
        } catch (Exception e) {
          throw new RuntimeException("couldn't fetch JbpmSessionFactory from jndi '"+jndiName+"'");
        }
       
      } else { // else there is no JNDI name configured
        // create a new default instance.
        log.debug("building singleton JbpmSessionFactory");
        instance = buildJbpmSessionFactory();
      }
    }
    return instance;
  }

鍙互鐪嬪埌鍙彲浠ヤ慨鏀筳bpm.properties鏂囦歡灝眔k浜嗐?BR>

鐜板湪琛屽姩錛佺紪杈慾bpm\deploy\jbpm.sar涓殑jbpm.sar.cfg.jar鏂囦歡

灝咼bpmSessionFactory淇敼濡備笅
jbpm.scheduler.service.factory=org.jbpm.scheduler.impl.SchedulerServiceImpl
jbpm.task.instance.class=org.jbpm.taskmgmt.exe.TaskInstance
#jbpm.session.factory.jndi.name=java:/jbpm/JbpmSessionFactory
jbpm.hibernate.cfg.xml=jbpm.hibernate.cfg.xml
#jbpm.hibernate.properties=jbpm.hibernate.properties

鍥犳jbpm.hibernate.properties涔熷彲浠ュ垹闄や簡錛屼箣鍚庝慨鏀筳bpm.hibernate.cfg.xml鍜屽彟澶栦竴涓枃浠剁殑鏁版嵁搴撻厤緗紝鍙﹀寮勪釜鏁版嵁搴撶殑driver灝眔k鍟︼紒錛侊紒

]]>
jBPM涔媁ebSale鎹㈢敤MySQL DataSourcehttp://www.aygfsteel.com/fantasyginge/articles/27632.htmlfantasygingefantasygingeWed, 11 Jan 2006 11:07:00 GMThttp://www.aygfsteel.com/fantasyginge/articles/27632.htmlhttp://www.aygfsteel.com/fantasyginge/comments/27632.htmlhttp://www.aygfsteel.com/fantasyginge/articles/27632.html#Feedback2http://www.aygfsteel.com/fantasyginge/comments/commentRss/27632.htmlhttp://www.aygfsteel.com/fantasyginge/services/trackbacks/27632.html  鏍規(guī)嵁鍏徃宸ヤ綔闇瑕侊紝榪欎釜鍏冩棪寮濮嬫墠閫夊畾鐢╦BPM宸ヤ綔嫻佸紩鎿庯紝浠涔堜笢瑗塊兘鏄竴鐗囩┖鐧斤紝鑰宩BPM鐨別xample WebSale紼嬪簭鏄夌敤鐨勬妧鏈嵈鏄痡sf, hibernate錛屼竴鏃舵棤鎵閫備粠銆?BR>  娌″姙娉曞彧濂界‖鐫澶寸毊鍟冧笅鍘伙紝jsf錛宧ibernate
  榪欎袱澶╅兘蹇姄鐙備簡錛侊紒錛佹棤璁哄浣曢兘涓嶈兘浣跨敤鑷繁鍒涘緩鐨刴ysql鏁版嵁搴?IMG height=19 src="http://www.aygfsteel.com/Emoticons/cry_smile.gif" width=19 border=0>
  灝卞揩鏀懼純鐨勬椂鍊欙紝鑰佸ぉ緇堜簬鐪烽【鎴戝暒錛侊紒錛?IMG height=19 src="http://www.aygfsteel.com/Emoticons/regular_smile.gif" width=19 border=0>


   鏍規(guī)嵁涓浜涘墠浜虹殑blog鍜屽伐浣滄祦緹や笂鐨勪漢鐨勬寚鐐癸紝鐜版葷粨浠ヤ笅涓ょ閰嶇疆鐢╩ysql鏁版嵁搴揹atasource鐨勬柟娉曘?BR>
錛堜竴錛夐渶瑕佹敼jBPM婧愮爜錛堣繖涓柟娉曚笉澶ソ錛屼絾鏄彲浠ヨ璇繪簮鐮侊紝浜嗚В鏈哄埗錛?BR>

閰嶇疆榪炴帴 MySQL

1. 鍦?SPAN lang=EN-US>jbpm-3.0\lib鐩綍涓?鍒涘緩mysql鐩綍

2. 灝?SPAN lang=EN-US> mysql鏁版嵁搴撻┍鍔?SPAN lang=EN-US> (mysql-connector-java-3.1.7-bin.jar) copy鍒?SPAN lang=EN-US>mysql 鐩綍

3. 鍦?SPAN lang=EN-US> mysql 涓垱寤轟竴涓暟鎹簱錛屾暟鎹簱鍚嶅瓧

4. 鍦?SPAN lang=EN-US>jbpm-3.0\src\resources鐩綍涓嬪垱寤?SPAN lang=EN-US>mysql鐩綍

5. 鎶婁袱涓厤緗枃浠?SPAN lang=EN-US> (create.db.hibernate.properties, identity.db.xml) 浠?SPAN lang=EN-US>hsqldb鐩綍涓?鎷瘋礉鍒?SPAN lang=EN-US>mysql鐩綍
create.db.hibernate.properties鏂囦歡涓唴瀹瑰弬鑰冨涓嬶細(xì)

# these properties are used by the build script to create
# a hypersonic database in the build/db directory that contains
# the jbpm tables and a process deployed in there

hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost:3306/jbpm
hibernate.connection.username=jbpm
hibernate.connection.password=jbpm
hibernate.c3p0.min_size=1
hibernate.c3p0.max_size=3
hibernate.show_sql=true

6. 鍦╦bpm\lib涓嬪垱寤簃ysql鐩綍錛屾斁榪沵ysql鐨刯dbc  driver

7.淇敼build.deploy.xml  鏂囦歡涓璫reate.db task

<target name="create.db" depends="declare.jbpm.tasks, db.clean" description="creates a hypersonic database with the jbpm tables and loads the processes in there">
     <jbpmschema actions="create" properties="${basedir}/src/resources/mysql/create.db.hibernate.properties"/>
     <loadidentities file="${basedir}/src/resources/mysql/identity.db.xml" properties="${basedir}/src/resources/mysql/create.db.hibernate.properties"/>
     <ant antfile="build.xml" target="build.processes" inheritall="false" />
     <deploypar properties="${basedir}/src/resources/mysql/create.db.hibernate.properties">
       <fileset dir="build" includes="*.par" />
     </deploypar>
   </target>



 鍥犱負(fù) Hibernate 涓嶈兘灝嗗畠鐨?SPAN lang=EN-US>SessionFactory涓?SPAN lang=EN-US>tomcat
鐨?SPAN lang=EN-US>jndi
緇戝畾 , 鎴戜滑鐩存帴鍦ㄦ簮鐮佷腑淇敼

9. 鎵撳紑婧愭枃浠?SPAN lang=EN-US> JbpmSessionFactory.java, 鍦?SPAN lang=EN-US> getInstance() 鏂規(guī)硶閲?SPAN lang=EN-US>, 鍒犻櫎涓嬮潰浠g爜

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

灝嗕笅闈㈣繖琛?SPAN lang=EN-US>

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

鏇挎崲涓?SPAN lang=EN-US> instance = (JbpmSessionFactory)
PortableRemoteObject.narrow(
new JbpmSessionFactory(createConfiguration()), JbpmSessionFactory.class);

10.鍦?SPAN lang=EN-US> createConfiguration(String configResource) 鏂規(guī)硶閲?SPAN lang=EN-US>, 娉ㄩ噴鎺夎繖孌典唬鐮?SPAN lang=EN-US>

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); 
 }

鍚屾椂鍔犲叆涓嬮潰鐨勪唬鐮?SPAN lang=EN-US>

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");

11.榪欑鏂規(guī)硶闇瑕佸厛寮starter-kit涓殑jboss錛岀劧鍚巄uild websale錛屾渶鍚巇eploy

鍙傝冩枃绔狅細(xì)
http://mdvjiangbin.bokee.com/3185679.html
http://www.aygfsteel.com/znjqolf/archive/2005/12/19/24654.html
榪樻湁濂藉錛屾煡榪囦箣鍚庨兘蹇樹簡閾炬帴浜嗭紝璋㈣阿鍓嶄漢鐨勬葷粨錛?BR>


鏂規(guī)硶浜岋細(xì)
1錛屽湪starter-kit server涓儴緗茬殑jbpm搴旂敤閲岀殑deploy鐩綍涓垱寤簃ysql-ds.xml

鏂囦歡鍐呭鍙傝冨涓嬶細(xì)
<?xml version="1.0" encoding="UTF-8"?>

<!-- The Hypersonic embedded database JCA connection factory config
$Id: hsqldb-ds.xml,v 1.15 2004/09/15 14:37:40 loubyansky Exp $ -->

<datasource>
   <local-tx-datasource>

      <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
      <!-- Datasources are not available outside the virtual machine -->
      <jndi-name>DefaultDS</jndi-name>

      <!-- for tcp connection, allowing other processes to use the hsqldb
      database. This requires the org.jboss.jdbc.HypersonicDatabase mbean.
      <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
-->
      <!-- for totally in-memory db, not saved when jboss stops.
      The org.jboss.jdbc.HypersonicDatabase mbean necessary
      <connection-url>jdbc:hsqldb:.</connection-url>
-->
      <!-- for in-process persistent db, saved when jboss stops. The
      org.jboss.jdbc.HypersonicDatabase mbean is necessary for properly db shutdown
-->
      <connection-url>jdbc:mysql://localhost:3306/jbpm</connection-url>

      <!-- The driver class -->
      <driver-class>com.mysql.jdbc.Driver</driver-class>

      <!-- The login and password -->
      <user-name>jbpm</user-name>
      <password>jbpm</password>

      <!--example of how to specify class that determines if exception means connection should be destroyed-->
      <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->

      <!-- this will be run before a managed connection is removed from the pool for use by a client-->
      <!--<check-valid-connection-sql>select * from something</check-valid-connection-sql> -->

      <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
      <min-pool-size>5</min-pool-size>

      <!-- The maximum connections in a pool/sub-pool -->
      <max-pool-size>20</max-pool-size>

      <!-- The time before an unused connection is destroyed -->
      <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
      <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
      <idle-timeout-minutes>0</idle-timeout-minutes>
  
   </local-tx-datasource>
        <metadata>
  <type-mapping>mySQL</type-mapping>
  </metadata>
 </datasource>


2錛屽垹闄よ鐩綍鏈夊叧hsqldb  璁劇疆datasource鐨勪袱涓獂ml鏂囦歡銆?BR>
3錛宔dit 涓婁竴鐩綍conf涓嬬殑standardjaws.xml涓殑榪欐
<datasource>java:/DefaultDS</datasource>
   <type-mapping>mySQL</type-mapping>
璁﹖ype-mapping瀵瑰簲mysql-ds.xml涓殑type-mapping

Step 4: JMS configuration descriptors
a) Remove hsqldb-jdbc2-service.xml from folder deploy/jms. Save this file somewhere else.

b) Copy mysql-jdbc2-service.xml from folder docs/example/jms to deploy/jms.

c) Edit mysql-jdbc2-service.xml and change the datasource name if applicable. In my configuration I don't use HSQL at all so I configured the default datasource DefaultDS for MySQL. In this file, change mySQLDS to DefaultDS. Note that datasource names are case sensitive.

Step 5: Install MySQL Java Connector
Download MySQL Connector/J and place the file mysql-connector-java-3.0.15-ga-bin.jar in the lib folder of the server.



錛侊紒錛佸悓鏃墮渶瑕佷慨鏀筪eploy涓璲bpm.sar鏂囦歡澶歸噷鐨刯bpm.sar.cfg.jar鏂囦歡錛屾洿鏂拌鏂囦歡閲岄潰鐨勬暟鎹簱閰嶇疆


鍙傝冩枃绔狅細(xì)
http://wiki.jboss.org/wiki/Wiki.jsp?page=SetUpAMysqlDatasource
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3861605



]]>
主站蜘蛛池模板: 长岛县| 舟曲县| 嘉祥县| 日喀则市| 葫芦岛市| 孝义市| 万宁市| 喀什市| 扬中市| 隆德县| 祁门县| 泰和县| 江永县| 墨江| 兴城市| 余姚市| 德令哈市| 九寨沟县| 屏边| 克拉玛依市| 张家港市| 南平市| 大庆市| 齐齐哈尔市| 洪洞县| 皮山县| 云南省| 明光市| 丘北县| 增城市| 满城县| 米脂县| 邳州市| 衡阳县| 柳河县| 炉霍县| 布拖县| 迭部县| 中卫市| 鄂尔多斯市| 内江市|