AnsweredAssumed Answered

Problem with SAXParsr

Question asked by jusafa on Jan 10, 2013
Latest reply on Jan 10, 2013 by frederikheremans1
I use Activiti engine 5.11 integrated with Spring framework on JBoss 7.1.1. Deploying through Activiti explorer is OK. Deploying programmatically throws exception.

Application:
processEngine.getRepositoryService()
      .createDeployment()
      .name("Sync contact")
      .addClasspathResource("cz/ness/itaas/fxb/SyncContactProcess.bpmn20.xml")
      .deploy();

Log:
14:45:36,604 SEVERE [org.activiti.engine.impl.interceptor.CommandContext] (MSC service thread 1-3) Error while closing command context: org.activiti.engine.ActivitiException: cos-ct-extends.1.4.2.2.2.2.1: Error for type 'tExpression'.  The content type of a derived type and that of its base must both be mixed or element-only. | cz/ness/itaas/fxb/MyProcess.bpmn20.xml | line 6 | column 56
cos-ct-extends.1.4.2.2.2.2.1: Error for type 'tFormalExpression'.  The content type of a derived type and that of its base must both be mixed or element-only. | cz/ness/itaas/fxb/MyProcess.bpmn20.xml | line 716 | column 70

   at org.activiti.engine.impl.util.xml.Parse.throwActivitiExceptionForErrors(Parse.java:186) [activiti-engine-5.11.jar:5.11]
   at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:242) [activiti-engine-5.11.jar:5.11]
   at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:92) [activiti-engine-5.11.jar:5.11]
   at org.activiti.engine.impl.persistence.deploy.DeploymentCache.deploy(DeploymentCache.java:38) [activiti-engine-5.11.jar:5.11]
   at org.activiti.engine.impl.persistence.entity.DeploymentManager.insertDeployment(DeploymentManager.java:44) [activiti-engine-5.11.jar:5.11]
   at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:61) [activiti-engine-5.11.jar:5.11]
   at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:33) [activiti-engine-5.11.jar:5.11]
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) [activiti-engine-5.11.jar:5.11]
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:60) [activiti-engine-5.11.jar:5.11]
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42) [activiti-spring-5.11.jar:]
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) [spring-tx-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40) [activiti-spring-5.11.jar:]
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:38) [activiti-engine-5.11.jar:5.11]
   at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:68) [activiti-engine-5.11.jar:5.11]
   at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:119) [activiti-engine-5.11.jar:5.11]
   at cz.ness.itaas.demo.DemoDataGenerator.initProcessDefinitions(DemoDataGenerator.java:135) [workflow-lib-0.0.1-SNAPSHOT.jar:]
   at cz.ness.itaas.demo.DemoDataGenerator.init(DemoDataGenerator.java:48) [workflow-lib-0.0.1-SNAPSHOT.jar:]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_05]
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_05]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_05]
   at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_05]
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1581) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609) [spring-beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) [spring-context-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469) [spring-context-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) [spring-web-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) [spring-web-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [spring-web-3.1.2.RELEASE.jar:3.1.2.RELEASE]
   at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
   at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
   at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
   at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_05]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_05]
   at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05]

Process definition:
<?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://activiti.org/bpmn20">
  <process id="syncGAPFXBContact" name="New FXB contact process">
    <startEvent id="startevent1" name="Start"></startEvent>
    <userTask id="createContactUsertask" name="create contact" activiti:candidateGroups="aro_fxb_contact_employ">
      <extensionElements>
        <activiti:formProperty id="nextCandidateGroup" value="aro_fxb_contact_approver" default="aro_fxb_contact_approver" required="true" readable="true" writable="false"></activiti:formProperty>
      </extensionElements>
    </userTask>
    <userTask id="approveContactUsertask" name="approve contact" activiti:assignee="${approver}" activiti:candidateGroups="aro_fxb_contact_approver"></userTask>
    <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
    <serviceTask id="createFXBContactServicetask" name="create FXB contact" activiti:async="true" activiti:class="cz.ness.itaas.v1.fxb.FXBSendContactService"></serviceTask>
    <endEvent id="endevent1" name="End"></endEvent>
    <serviceTask id="sendRejectMail" name="send reject mail" activiti:async="true" activiti:class="cz.ness.itaas.v1.fxb.FXBSendRejectMailService"></serviceTask>
    <serviceTask id="sendRequestMail" name="send request mail" activiti:async="true" activiti:class="cz.ness.itaas.v1.fxb.FXBSendRequestMailService"></serviceTask>
    <parallelGateway id="parallelgateway1" name="Parallel Gateway"></parallelGateway>
    <sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="createContactUsertask"></sequenceFlow>
    <sequenceFlow id="flow3" name="" sourceRef="approveContactUsertask" targetRef="exclusivegateway1"></sequenceFlow>
    <sequenceFlow id="flow4" name="approved" sourceRef="exclusivegateway1" targetRef="createFXBContactServicetask">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${choice == 'approved'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow6" name="" sourceRef="createFXBContactServicetask" targetRef="endevent1"></sequenceFlow>
    <sequenceFlow id="flow7" name="rejected" sourceRef="exclusivegateway1" targetRef="sendRejectMail">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${choice == 'rejected'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow8" name="" sourceRef="sendRejectMail" targetRef="endevent1"></sequenceFlow>
    <sequenceFlow id="flow9" name="" sourceRef="createContactUsertask" targetRef="parallelgateway1"></sequenceFlow>
    <sequenceFlow id="flow10" name="" sourceRef="parallelgateway1" targetRef="approveContactUsertask"></sequenceFlow>
    <sequenceFlow id="flow11" name="" sourceRef="parallelgateway1" targetRef="sendRequestMail"></sequenceFlow>
    <sequenceFlow id="flow12" name="" sourceRef="sendRequestMail" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_syncGAPFXBContact">
    <bpmndi:BPMNPlane bpmnElement="syncGAPFXBContact" id="BPMNPlane_syncGAPFXBContact">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35" width="35" x="110" y="220"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="createContactUsertask" id="BPMNShape_createContactUsertask">
        <omgdc:Bounds height="55" width="105" x="190" y="210"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="approveContactUsertask" id="BPMNShape_approveContactUsertask">
        <omgdc:Bounds height="55" width="105" x="400" y="210"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
        <omgdc:Bounds height="40" width="40" x="549" y="218"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="createFXBContactServicetask" id="BPMNShape_createFXBContactServicetask">
        <omgdc:Bounds height="55" width="105" x="609" y="141"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35" width="35" x="729" y="221"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sendRejectMail" id="BPMNShape_sendRejectMail">
        <omgdc:Bounds height="55" width="105" x="609" y="284"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="sendRequestMail" id="BPMNShape_sendRequestMail">
        <omgdc:Bounds height="55" width="105" x="400" y="90"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="parallelgateway1" id="BPMNShape_parallelgateway1">
        <omgdc:Bounds height="40" width="40" x="330" y="217"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="145" y="237"></omgdi:waypoint>
        <omgdi:waypoint x="190" y="237"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="505" y="237"></omgdi:waypoint>
        <omgdi:waypoint x="549" y="238"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="569" y="218"></omgdi:waypoint>
        <omgdi:waypoint x="568" y="168"></omgdi:waypoint>
        <omgdi:waypoint x="609" y="168"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14" width="100" x="2" y="31"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
        <omgdi:waypoint x="714" y="168"></omgdi:waypoint>
        <omgdi:waypoint x="746" y="168"></omgdi:waypoint>
        <omgdi:waypoint x="746" y="221"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
        <omgdi:waypoint x="569" y="258"></omgdi:waypoint>
        <omgdi:waypoint x="568" y="311"></omgdi:waypoint>
        <omgdi:waypoint x="609" y="311"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14" width="100" x="2" y="-47"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
        <omgdi:waypoint x="714" y="311"></omgdi:waypoint>
        <omgdi:waypoint x="746" y="311"></omgdi:waypoint>
        <omgdi:waypoint x="746" y="256"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
        <omgdi:waypoint x="295" y="237"></omgdi:waypoint>
        <omgdi:waypoint x="330" y="237"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
        <omgdi:waypoint x="370" y="237"></omgdi:waypoint>
        <omgdi:waypoint x="400" y="237"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
        <omgdi:waypoint x="350" y="217"></omgdi:waypoint>
        <omgdi:waypoint x="349" y="118"></omgdi:waypoint>
        <omgdi:waypoint x="400" y="117"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
        <omgdi:waypoint x="505" y="117"></omgdi:waypoint>
        <omgdi:waypoint x="746" y="117"></omgdi:waypoint>
        <omgdi:waypoint x="746" y="221"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>


Difference in debug mode:
org.activiti.engine.impl.util.xml.Parse.java:128
  SAXParser has different xmlReader:
-   activiti-explorer - org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser@55731344
-   program with activiti engine - org.apache.xerces.parsers.SAXParser@505acb63

How can I get SAXParser with same xmlReader? Do you know where is my problem?

Outcomes