jBPM 棄用jndi DataSource

             昨天胡搞了一天,雖然弄好了jBPM的數(shù)據(jù)庫設(shè)置,但是經(jīng)過昨晚回去查看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類中
           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ù)庫配置,另外弄個(gè)數(shù)據(jù)庫的driver就ok啦!!!
          posted on 2006-01-12 10:23 fantasyginge 閱讀(542) 評(píng)論(0)  編輯  收藏 所屬分類: 工作流之jBPM

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


          網(wǎng)站導(dǎo)航:
           
           
          主站蜘蛛池模板: 集贤县| 蛟河市| 宜川县| 义马市| 梓潼县| 霍林郭勒市| 凤山市| 准格尔旗| 台中市| 静安区| 花垣县| 陇川县| 陵川县| 无极县| 靖江市| 江源县| 绩溪县| 大丰市| 沙坪坝区| 祁连县| 岗巴县| 安乡县| 会泽县| 镇赉县| 巴里| 苍梧县| 肥西县| 故城县| 咸阳市| 松滋市| 罗城| 广昌县| 简阳市| 云林县| 望都县| 夏津县| 博白县| 大理市| 九寨沟县| 藁城市| 财经|