[jboss-user] [jBPM Users] - Re: [jbpm 4.2] My first simple application doesn't work :(

-Silver- do-not-reply at jboss.com
Sat Dec 5 09:49:52 EST 2009


Thanks!
I tried with your code but I received this exception:

  | java.lang.ExceptionInInitializerError
  | Caused by: org.jbpm.api.JbpmException: 
  |   error: couldn't parse xml document : org.jbpm.api.JbpmException: resource jbpm.cfg.xml does not exist
  |   error: parsing exception: null : java.lang.NullPointerException
  | 	at org.jbpm.pvm.internal.xml.ProblemList.getJbpmException(ProblemList.java:175)
  | 	at org.jbpm.pvm.internal.xml.ProblemList.getJbpmException(ProblemList.java:141)
  | 	at org.jbpm.pvm.internal.xml.Parse.checkErrors(Parse.java:190)
  | 	at org.jbpm.pvm.internal.cfg.ProcessEngineImpl.parse(ProcessEngineImpl.java:222)
  | 	at org.jbpm.pvm.internal.cfg.ProcessEngineImpl.setResource(ProcessEngineImpl.java:194)
  | 	at org.jbpm.api.Configuration.setResource(Configuration.java:109)
  | 	at org.jbpm.api.Configuration.getProcessEngine(Configuration.java:161)
  | 	at prova.Main.<clinit>(Main.java:17)
  | Caused by: org.jbpm.api.JbpmException
  | 	at org.jbpm.pvm.internal.xml.ProblemList.getJbpmException(ProblemList.java:171)
  | 	... 7 more
  | Caused by: java.lang.NullPointerException
  | 	at org.jbpm.pvm.internal.util.XmlUtil.attribute(XmlUtil.java:289)
  | 	at org.jbpm.pvm.internal.env.JbpmConfigurationParser.parseDocument(JbpmConfigurationParser.java:68)
  | 	at org.jbpm.pvm.internal.xml.Parser.execute(Parser.java:396)
  | 	at org.jbpm.pvm.internal.xml.Parse.execute(Parse.java:158)
  | 	... 5 more
  | Exception in thread "main" 

What could be the problem? Those are the two files of my project:
Main.java
import org.jbpm.api.Configuration;
  | import org.jbpm.api.ExecutionService;
  | import org.jbpm.api.ProcessDefinition;
  | import org.jbpm.api.ProcessEngine;
  | import org.jbpm.api.ProcessInstance;
  | import org.jbpm.api.RepositoryService;
  | 
  | public class Main{
  |     private static ProcessEngine processEngine;
  | 
  |     private static RepositoryService repositoryService;
  |     private static ExecutionService executionService;
  | 
  |     static {
  | 	    processEngine = Configuration.getProcessEngine();
  | 
  | 	    repositoryService = processEngine.get(RepositoryService.class);
  | 	    executionService = processEngine.getExecutionService();
  |     }
  | 
  |     /**
  |      * @param args
  |      */
  |     public static void main(String[] args) {
  | 	    //create new deployment object and ask it to deploy your flow
  | 	   String deploymentId = repositoryService.createDeployment().addResourceFromClasspath("sampleprocess.jpdl.xml").deploy();
  | 
  | 	   //now we query the process definition
  | 	   ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().deploymentId(deploymentId).uniqueResult();
  | 
  | 	   //start the process instance with the Id of the process definition
  | 	  ProcessInstance processInstance = executionService.startProcessInstanceById(processDefinition.getId());
  |     }
  | }
  | 

and sampleprocess.jpdl
<?xml version="1.0" encoding="UTF-8"?>
  | 
  | <process name="sampleprocess" xmlns="http://jbpm.org/4.0/jpdl">
  |    <start name="start1" g="238,73,48,48">
  |       <transition name="to end1" to="end1" g="-45,-20"/>
  |    </start>
  |    <end name="end1" g="267,271,48,48"/>
  | </process>

Regarding to files that I described in my precedent post, I copied them directly from the PVM documentation, (Page 5 - 6 chapter 2). Could you send me the link to the correct PVM documentation? 

Thanks!

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4269137#4269137

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4269137



More information about the jboss-user mailing list