5 Replies Latest reply on Dec 18, 2009 4:23 AM by jbarrez

    [jBPM4] Cant build processEngine using setFile, setURL or se

    edeleflie

      I want to move jbpm.hibernate.cfg.xml out of my classpath and into a separate folder. I'm doing it like this:

      processEngine = new Configuration().setFile( new File("myFilePath")).buildProcessEngine()

      I get the same stack trace as when using setURL and set XMLString. THat stack trace looks something like this:

      Caused by: java.lang.NullPointerException
      at org.jbpm.pvm.internal.cfg.ProcessEngineImpl.checkDb(ProcessEngineImpl.java:177)
      at org.jbpm.pvm.internal.cfg.ProcessEngineImpl.buildProcessEngine(ProcessEngineImpl.java:170)

      Is there somethign I have misunderstood ... or does this look like a bug?

      Etienne

        • 1. Re: [jBPM4] Cant build processEngine using setFile, setURL o
          edeleflie

          based on lack of replies should I post a bug report?

          • 2. Re: [jBPM4] Cant build processEngine using setFile, setURL o
            saraswati.santanu

            Somehow missed your post earlier.

            It seems you do not have a command service in your jbpm.cfg.xml with a name "txRequiredCommandService". You need an entry something like this (you may need to change as per your exact requirement):

             <command-service name="txRequiredCommandService">
             <skip-interceptor />
             <retry-interceptor />
             <environment-interceptor />
             <standard-transaction-interceptor />
             </command-service>
            



            • 3. Re: [jBPM4] Cant build processEngine using setFile, setURL o
              edeleflie

              thanks Saraswati.

              Can you point me to the documentation of this requirement? (of adding XML to jbpm.cfg.xml for an API call to work).

              I'm struggling understanding where I am supposed to go to determine exactly what needs to be included in jbpm.cfg.xml for my API calls to work.

              Etienne

              • 4. Re: [jBPM4] Cant build processEngine using setFile, setURL o
                saraswati.santanu

                Etienne,
                Command service is something you need to configure to get Jbpm running. But the magic is in the name of the command service. "txRequiredCommandService" and "newTxRequiredCommandService" are two hard coded names used for command service. "txRequiredCommandService" is the command service used in method checkDb().

                This is somewhat unintuitive and wish this will be changed to something more intuitive like "find any command service available irrespective of the name" in some future release. Or at least document this very clearly so that nobody misses it.

                There is no formal documentation for this - at least I have not come across any. You can refer to the sample configuration provided with the source code. They are good.

                • 5. Re: [jBPM4] Cant build processEngine using setFile, setURL o
                  jbarrez

                  The reason for this is that we try to encourage the use of the <import>s as much as possible. When you look at for example jbpm.tx.hibernate.cfg, you can see that the command services are already correctly named.