jBPM 棄用jndi DataSource

             昨天胡搞了一天,雖然弄好了jBPM的數(shù)據(jù)庫設(shè)置,但是經(jīng)過昨晚回去查看Help 關(guān)于deployment的文檔和相關(guā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.


          源碼中的這個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;
            }

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


          現(xiàn)在行動!編輯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和另外一個文件的數(shù)據(jù)庫配置,另外弄個數(shù)據(jù)庫的driver就ok啦!!!
          posted on 2006-01-12 10:23 fantasyginge 閱讀(544) 評論(0)  編輯  收藏 所屬分類: 工作流之jBPM

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
           
          主站蜘蛛池模板: 邹平县| 武川县| 赣榆县| 疏附县| 鹤壁市| 苗栗市| 专栏| 阳信县| 襄汾县| 板桥市| 安图县| 晋江市| 莱州市| 即墨市| 万安县| 桐城市| 宝山区| 正蓝旗| 澎湖县| 吉隆县| 泾源县| 河东区| 张掖市| 顺平县| 瓮安县| 蒙阴县| 襄垣县| 蒙自县| 盐城市| 潞西市| 如皋市| 榕江县| 保德县| 汶川县| 军事| 邵东县| 凯里市| 农安县| 华阴市| 额敏县| 井陉县|