jBPM 棄用jndi DataSource

             昨天胡搞了一天,雖然弄好了jBPM的數(shù)據(jù)庫(kù)設(shè)置,但是經(jīng)過(guò)昨晚回去查看Help 關(guān)于deployment的文檔和相關(guān)的源碼,終于弄出最簡(jiǎn)單的方法。


          Help Deployment中關(guān)于jbpm.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.


          源碼中的這個(gè)JbpmSessionFactory.java類(lèi)中
           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;
            }

          可以看到只可以修改jbpm.properties文件就ok了。


          現(xiàn)在行動(dòng)!編輯jbpm\deploy\jbpm.sar中的jbpm.sar.cfg.jar文件

          將JbpmSessionFactory修改如下
          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也可以刪除了,之后修改jbpm.hibernate.cfg.xml和另外一個(gè)文件的數(shù)據(jù)庫(kù)配置,另外弄個(gè)數(shù)據(jù)庫(kù)的driver就ok啦!!!
          posted on 2006-01-12 10:23 fantasyginge 閱讀(544) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): 工作流之jBPM

          只有注冊(cè)用戶(hù)登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
           
          主站蜘蛛池模板: 安图县| 义马市| 南皮县| 甘孜县| 榆林市| 乐陵市| 黑山县| 宣汉县| 沧源| 彰化县| 义乌市| 铜鼓县| 宜昌市| 黄梅县| 衡阳县| 漳平市| 林口县| 潜山县| 岫岩| 毕节市| 新宁县| 永吉县| 黔西| 德庆县| 勃利县| 晴隆县| 漠河县| 防城港市| 东明县| 育儿| 上犹县| 白河县| 上栗县| 那坡县| 司法| 二连浩特市| 金昌市| 德州市| 肇庆市| 葵青区| 巴彦淖尔市|