AnsweredAssumed Answered

Problems deploying a process

Question asked by daveb on May 4, 2011
Latest reply on May 9, 2011 by esteban.roblesluna
Hi,

I've been trying to deploy a simple .bpmn20.xml file, and am not getting much joy either programmatically or through the Probe interface. The BPMN 2.0 file is shown below:


<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:activiti="http://activiti.org/bpmn"
          xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
          xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
          xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
          typeLanguage="http://www.w3.org/2001/XMLSchema"
          expressionLanguage="http://www.w3.org/1999/XPath"
          targetNamespace="http://www.activiti.org/test">
  <import importType="http://schemas.xmlsoap.org/wsdl/" location="http://localhost:8029/helloworld?wsdl" namespace="http://webservice.activiti.org"></import>
  <process id="HelloWorldProcess" name="DBProcess1">
    <documentation>Place documentation for the 'HelloWorldProcess' process here.</documentation>
    <startEvent id="startevent1" name="Start"></startEvent>
    <endEvent id="endevent1" name="End"></endEvent>
    <serviceTask id="servicetask1" name="Service Task" activiti:class="com.amdocs.examples.HelloWorldWS"></serviceTask>
    <sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow>
    <sequenceFlow id="flow2" name="" sourceRef="servicetask1" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_HelloWorldProcess">
    <bpmndi:BPMNPlane bpmnElement="HelloWorldProcess" id="BPMNPlane_HelloWorldProcess">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35" width="35" x="120" y="240"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35" width="35" x="470" y="240"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="servicetask1" id="BPMNShape_servicetask1">
        <omgdc:Bounds height="55" width="105" x="280" y="230"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="155" y="257"></omgdi:waypoint>
        <omgdi:waypoint x="280" y="257"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="385" y="257"></omgdi:waypoint>
        <omgdi:waypoint x="470" y="257"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

Everything works just fine when I remove the
<import>….. </import>
line from the above, but when the import line is in I get an error when running the deployment code below:


public class RunHelloWorld {

   /**
    * @param args
    */
   public static void main(String[] args) {
      // Create Activiti process engine
      ProcessEngine processEngine = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration().buildProcessEngine();
      
      // Get Activiti services
      RepositoryService repositoryService = processEngine.getRepositoryService();
      RuntimeService runtimeService = processEngine.getRuntimeService();
      
      // Deploy the process definition
      repositoryService.createDeployment().addClasspathResource("HelloWorldProcess.bpmn20.xml").deploy();
      
      /**
      // Start a process instance
      runtimeService.startProcessInstanceByKey("financialReport");
      
      TaskService taskService = processEngine.getTaskService();
      
      
      List<Task> tasks = taskService.createTaskQuery().taskCandidateGroup("accountancy").list();
      
      taskService.claim((tasks.get(0).getId()), "fozzie");
      */
      

   }
}


The console output I am getting in eclipse is:


SLF4J: The requested version 1.6 by your slf4j binding is not compatible with [1.5.5, 1.5.6]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
May 4, 2011 3:06:57 PM org.activiti.engine.impl.ProcessEngineImpl <init>
INFO: ProcessEngine default created
May 4, 2011 3:06:57 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource HelloWorldProcess.bpmn20.xml
May 4, 2011 3:06:57 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
May 4, 2011 3:06:57 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
May 4, 2011 3:06:57 PM org.activiti.engine.impl.bpmn.parser.BpmnParse execute
SEVERE: Uknown exception
java.lang.ClassCastException: org.apache.xerces.dom.DeferredCommentImpl cannot be cast to org.w3c.dom.Element
   at org.activiti.engine.impl.webservice.WSDLImporter.getRootTypes(WSDLImporter.java:213)
   at org.activiti.engine.impl.webservice.WSDLImporter.importTypes(WSDLImporter.java:165)
   at org.activiti.engine.impl.webservice.WSDLImporter.importFrom(WSDLImporter.java:93)
   at org.activiti.engine.impl.webservice.WSDLImporter.importFrom(WSDLImporter.java:79)
   at org.activiti.engine.impl.bpmn.parser.BpmnParse.parseImports(BpmnParse.java:248)
   at org.activiti.engine.impl.bpmn.parser.BpmnParse.parseRootElement(BpmnParse.java:184)
   at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:163)
   at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:81)
   at org.activiti.engine.impl.persistence.deploy.DeploymentCache.deploy(DeploymentCache.java:37)
   at org.activiti.engine.impl.persistence.entity.DeploymentManager.insertDeployment(DeploymentManager.java:39)
   at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:57)
   at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:30)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:43)
   at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:105)
   at RunHelloWorld.main(RunHelloWorld.java:26)

I have tried putting the xerces libraries in java's endorsed directory, and have tried on both java 5 and java 6 - same error in both cases.

Has anyone seen this one before, or have any other suggestions ….

Many thanks in advance.

Outcomes