jBPM 棄用jndi DataSource

             昨天胡搞了一天,雖然弄好了jBPM的數據庫設置,但是經過昨晚回去查看Help 關于deployment的文檔和相關的源碼,終于弄出最簡單的方法。


          Help Deployment中關于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了。


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

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


          網站導航:
           
           
          主站蜘蛛池模板: 扬州市| 金堂县| 溧阳市| 墨竹工卡县| 紫云| 绥棱县| 桃源县| 宣威市| 康保县| 安图县| 如皋市| 曲沃县| 上杭县| 郎溪县| 东港市| 洞头县| 富阳市| 彩票| 宁河县| 贡觉县| 通城县| 长葛市| 禹城市| 普陀区| 曲松县| 南丰县| 白沙| 峨眉山市| 南京市| 博湖县| 高密市| 陆良县| 邮箱| 无锡市| 进贤县| 治县。| 平昌县| 保山市| 资中县| 阆中市| 田阳县|