AnsweredAssumed Answered

Deployment on Activiti Workflow Engine: NullPointerException Error

Question asked by activiti_5.14 on Mar 27, 2014
Latest reply on Mar 31, 2014 by martin.grofcik
currently I am working with Activiti Workflow Engine and I am trying to deploy the process programmitically by using Eclipse. However everytime I tried to run the class file as Java Application, I always get following error

<blockcode>Exception in thread "main" java.lang.NullPointerException at createEngine.main(createEngine.java:9)</blockcode>

Here is my Code for the Deployment:



import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;

public class createEngine {
    public static void main(String[] args)
    {
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        RepositoryService repositoryService = processEngine.getRepositoryService();

        repositoryService.createDeployment()
          .addClasspathResource("accidentForm.bpmn20.xml")
          .deploy();

        System.out.println("Number of process definitions: " + repositoryService.createProcessDefinitionQuery().count());
    }
}



Moreover, after get this error I tried to print the value of <blockcode>processEngine</blockcode> by using bellow code:



import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;

public class createEngine {
    public static void main(String[] args)
    {
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        System.out.println(processEngine);
    }
}



And it return <blockcode>null</blockcode> value (I don't know whether it is normal or not).

Additional info: The Activiti Workflow Engine running above Tomcat 7 and within Windows 7 environment. Also, for your information, I have also tried to deploy the process by using activiti explorer and it is working without problem, so I am sure there is nothing wrong with my xml file.

I have tried to find some information regarding this problem, but I could not find anything that can be used to solve this problem. Any idea about this problem? Thanks in advance

Outcomes