2 Replies Latest reply on Apr 19, 2007 11:06 AM by agafoor

    Problems starting process from MDB (EJB3, JBPm 3.2 alpha 2)

    nib

      Hi
      I have the following code to start a process:


      private void kickOffProcess(String processname, String [] attrnames, java.io.Serializable[] attrvalues) {
      try {
      org.jbpm.JbpmContext jbpmcontext = org.jbpm.JbpmConfiguration.getInstance().createJbpmContext();

      ---------------------------------------------------
      THE FOLLOWING LINE CAUSES THE EXCEPTION
      .............................................................
      org.jbpm.graph.def.ProcessDefinition pd = jbpmcontext.getGraphSession().findLatestProcessDefinition(processname);


      org.jbpm.graph.exe.ProcessInstance pi = new org.jbpm.graph.exe.ProcessInstance(pd);

      for (int i=0;i<attrnames.length;i++)
      pi.getContextInstance().setVariable(attrnames,attrvalues);
      pi.signal();


      } catch (Exception ex) { // Kann ja immer passieren
      log.info("!!! ERROR WEPLACM Main MDB: Unbekannte Exception. Grund: "+ex);
      ex.printStackTrace();
      }


      I get the following Exception (by the line marked above):
      org.hibernate.HibernateException: hibernate.cfg.xml not found

      Where do I have to store the hibernate.cfg.xml in my jar? And why? What else do I have to consider? The jar contains only a few entity and session beans as well as one MessageDrivenBean (with the code above). The beans work correct. I removed the logging-lines so that the code is more readable.
      I am not quite sure how to start a process correctly (with non-deprecated api functions) so any hints would be great ;-)

      Thank you!

      Greetz
      NiB