AnsweredAssumed Answered

Error deploying BPMN20 containing a Web Service Task

Question asked by ct1 on Jan 17, 2012
Latest reply on Feb 8, 2012 by ct1
In Activiti 5.8 Explorer, I am trying to deploy a BPMN20 file that contains a Web Service Task.  I have written a simple Web Service (very much like the one described in Activiti In Action, chapters 7 and 11).  I can call the Web Service from a Java client successfully.  I have tried to create a BPMN20 process that calls the same Web Service.  When I try to deploy the BPMN20 process via Explorer, I get the error shown below.

The jaxb-api-2.2.1.jar, which contains the javax.xml.bind.JAXBElement.class, is in the C:\Activiti\activiti-5.8\apps\apache-tomcat-6.0.32\webapps\activiti-explorer\WEB-INF\lib directory.  I ran "ant demo.start" from the C:\Activiti\activiti-5.8\setup directory.

After the attempt to deploy the process, Explorer shows both the .png and the .bpmn20.xml files, but there is no Process Definition listed on the Deployments page.

If you have time, please take a look, then let me know where my problem is and how I might correct it.

The exception received when I try to deploy the BPMN20 file:


INFO: Processing resource CheckPrevEmploymentProcess.bpmn20.xml
Jan 17, 2012 1:58:12 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Jan 17, 2012 1:58:12 PM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Jan 17, 2012 1:58:12 PM org.activiti.engine.impl.bpmn.parser.BpmnParse execute
SEVERE: Uknown exception
org.activiti.engine.ActivitiClassLoadingException: Class not found: javax.xml.bind.JAXBElement<java.
lang.String>       
        at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:81)
        at org.activiti.engine.impl.webservice.CxfWSDLImporter.importStructure(CxfWSDLImporter.java:
159)
        at org.activiti.engine.impl.webservice.CxfWSDLImporter.importTypes(CxfWSDLImporter.java:146)

        at org.activiti.engine.impl.webservice.CxfWSDLImporter.importFrom(CxfWSDLImporter.java:106)
        at org.activiti.engine.impl.webservice.CxfWSDLImporter.importFrom(CxfWSDLImporter.java:69)
        at org.activiti.engine.impl.bpmn.parser.BpmnParse.parseImports(BpmnParse.java:283)
        at org.activiti.engine.impl.bpmn.parser.BpmnParse.parseRootElement(BpmnParse.java:213)
        at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:192)
        at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:81)
        at org.activiti.engine.impl.persistence.deploy.DeploymentCache.deploy(DeploymentCache.java:3
7)
        at org.activiti.engine.impl.persistence.entity.DeploymentManager.insertDeployment(Deployment
Manager.java:39)
        at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:58)
        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(CommandContextInte
rceptor.java:42)
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInter
ceptor.java:42)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.j
ava:130)
        at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.jav
a:40)
        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.ja
va:106)
        at org.activiti.explorer.ui.management.deployment.DeploymentUploadReceiver.deployUploadedFil
e(DeploymentUploadReceiver.java:88)
        at org.activiti.explorer.ui.management.deployment.DeploymentUploadReceiver.uploadFinished(De
ploymentUploadReceiver.java:71)
        at org.activiti.explorer.ui.custom.UploadComponent.uploadFinished(UploadComponent.java:173)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)
        at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
        at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)
        at com.vaadin.ui.Upload.fireUploadSuccess(Upload.java:744)
        at com.vaadin.ui.Upload$1.streamingFinished(Upload.java:1022)
        at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.streamToReceiver(AbstractComm
unicationManager.java:593)
        at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleSimpleMultipartFileUp
load(AbstractCommunicationManager.java:469)
        at com.vaadin.terminal.gwt.server.CommunicationManager.handleFileUpload(CommunicationManager
.java:257)
        at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServ
let.java:495)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja
va:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBElement<java.lang.String>
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:62)
        … 49 more

The BPMN20 file I am trying to deploy is:


<?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"
   targetNamespace="http://www.activiti.org/test"
   xmlns:here="http://argo.com"
   >
   
   <import importType="http://schemas.xmlsoap.org/wsdl/"
         location="http://localhost:9090/PrevEmploymentCheckService/services/PreviousEmployment?wsdl"
         namespace="http://argo.com" />
   
   <message id="locatePrevEmplymntInfoMessage"
         itemRef="here:itemDefRef1" />
   <message id="locatePrevEmplymntInfoResponseMessage"
         itemRef="here:itemDefRef2" />
         
   <itemDefinition id="itemDefRef1"
         structureRef="here:CheckPreviousEmployment" />
   <itemDefinition id="itemDefRef2"
         structureRef="here:CheckPreviousEmploymentResponse" />

   <interface name ="Find Previous Employment Info"
      implementationRef="here:PreviousEmploymentPortType" >
      <operation id="findPrevEmploymentInfoOperation"
            name="Find Previous Employment Info Operation"
            implementationRef="here:CheckPreviousEmployment">
         <inMessageRef>
            here:locatePrevEmplymntInfoMessage   
         </inMessageRef>
         <outMessageRef>
            here:locatePrevEmplymntInfoResponseMessage
         </outMessageRef>
      </operation>
   </interface>
   
   <itemDefinition id="candidateName" structureRef="string" />
   <itemDefinition id="applicantName" structureRef="string" />
   <itemDefinition id="return" structureRef="string" />   
   <itemDefinition id="prevEmplInfo" structureRef="string" />
   
   <process id="CheckPrevEmploymentProcess" name="CheckPrevEmploymentProcess">
      <documentation>This is a callable process used to check for previous
         employment of the applicant at our company.</documentation>
      <startEvent id="checkPrevEmplymntStart" name="Check Previous Employment Start">
         <extensionElements>
            <activiti:formProperty id="candidateName"
               name="Name of Candidate"
               type="string"
               required="true"
               readable="true" writable="true"></activiti:formProperty>
         </extensionElements>
      </startEvent>
      
      <scriptTask id="logStart" name="Log Process Start"
         scriptFormat="groovy">
      <script><![CDATA[print "CheckPrevEmploymentProcess started with candidate name ${candidateName}.\n"]]></script>
      </scriptTask>
      <serviceTask id="callPrevEmplWebService" name="Call Prev Employment Web Service"
         implementation="##WebService"
         operationRef="here:findPrevEmploymentInfoOperation">
         
         <ioSpecification>
            <dataInput itemSubjectRef="here:itemDefRef1"
                     id="dataInput" />
            <dataOutput
                     itemSubjectRef="here:itemDefRef2"
                     id="dataOutput" />
                     
            <inputSet>
               <dataInputRefs>dataInput</dataInputRefs>
            </inputSet>
            <outputSet>
               <dataOutputRefs>dataOutput</dataOutputRefs>
            </outputSet>
         </ioSpecification>
         
         <dataInputAssociation>
            <sourceRef>candidateName</sourceRef>
            <targetRef>applicantName</targetRef>
         </dataInputAssociation>
         <dataOutputAssociation>
            <sourceRef>return</sourceRef>
            <targetRef>prevEmplInfo</targetRef>
         </dataOutputAssociation>      
      </serviceTask>
      
      <sequenceFlow id="flow2" name="" sourceRef="callPrevEmplWebService"
         targetRef="logAfterWebSvcCall"></sequenceFlow>
      <scriptTask id="logAfterWebSvcCall" name="Log Prev Emplymnt Info"
         scriptFormat="groovy">
         <script><![CDATA[print "After Call Prev Employment Web Service task,
                     candidateName is ${candidateName}.\n
                     And prevEmplInfo is ${prevEmplInfo}.\n"]]></script>
      </scriptTask>
      <endEvent id="checkPrevEmplymntEnd" name="Check Prev Emplymnt End"></endEvent>
      <sequenceFlow id="flow3" name="" sourceRef="logAfterWebSvcCall"
         targetRef="checkPrevEmplymntEnd"></sequenceFlow>
      <sequenceFlow id="flow4" name="" sourceRef="checkPrevEmplymntStart"
         targetRef="logStart"></sequenceFlow>
      <sequenceFlow id="flow5" name="" sourceRef="logStart"
         targetRef="callPrevEmplWebService"></sequenceFlow>
   </process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_CheckPrevEmploymentProcess">
      <bpmndi:BPMNPlane bpmnElement="CheckPrevEmploymentProcess"
         id="BPMNPlane_CheckPrevEmploymentProcess">
         <bpmndi:BPMNShape bpmnElement="checkPrevEmplymntStart"
            id="BPMNShape_checkPrevEmplymntStart">
            <omgdc:Bounds height="35" width="35" x="90" y="98"></omgdc:Bounds>
         </bpmndi:BPMNShape>
         <bpmndi:BPMNShape bpmnElement="callPrevEmplWebService"
            id="BPMNShape_callPrevEmplWebService">
            <omgdc:Bounds height="91" width="105" x="330" y="70"></omgdc:Bounds>
         </bpmndi:BPMNShape>
         <bpmndi:BPMNShape bpmnElement="logAfterWebSvcCall"
            id="BPMNShape_logAfterWebSvcCall">
            <omgdc:Bounds height="55" width="105" x="490" y="88"></omgdc:Bounds>
         </bpmndi:BPMNShape>
         <bpmndi:BPMNShape bpmnElement="checkPrevEmplymntEnd"
            id="BPMNShape_checkPrevEmplymntEnd">
            <omgdc:Bounds height="35" width="35" x="650" y="98"></omgdc:Bounds>
         </bpmndi:BPMNShape>
         <bpmndi:BPMNShape bpmnElement="logStart" id="BPMNShape_logStart">
            <omgdc:Bounds height="55" width="105" x="170" y="88"></omgdc:Bounds>
         </bpmndi:BPMNShape>
         <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
            <omgdi:waypoint x="435" y="115"></omgdi:waypoint>
            <omgdi:waypoint x="490" y="115"></omgdi:waypoint>
         </bpmndi:BPMNEdge>
         <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
            <omgdi:waypoint x="595" y="115"></omgdi:waypoint>
            <omgdi:waypoint x="650" y="115"></omgdi:waypoint>
         </bpmndi:BPMNEdge>
         <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
            <omgdi:waypoint x="125" y="115"></omgdi:waypoint>
            <omgdi:waypoint x="170" y="115"></omgdi:waypoint>
         </bpmndi:BPMNEdge>
         <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
            <omgdi:waypoint x="275" y="115"></omgdi:waypoint>
            <omgdi:waypoint x="330" y="115"></omgdi:waypoint>
         </bpmndi:BPMNEdge>
      </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
</definitions>

The WSDL of the Web Service I am trying to call is:


  <?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
   xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://argo.com"
   xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
   xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
   targetNamespace="http://argo.com">
   <wsdl:documentation>Please Type your service description here
   </wsdl:documentation>
   <wsdl:types>
      <xs:schema attributeFormDefault="qualified"
         elementFormDefault="qualified" targetNamespace="http://argo.com">
         <xs:element name="CheckPreviousEmployment">
            <xs:complexType>
               <xs:sequence>
                  <xs:element minOccurs="0" name="applicantName"
                     nillable="true" type="xs:string" />
               </xs:sequence>
            </xs:complexType>
         </xs:element>
         <xs:element name="CheckPreviousEmploymentResponse">
            <xs:complexType>
               <xs:sequence>
                  <xs:element minOccurs="0" name="return" nillable="true"
                     type="xs:string" />
               </xs:sequence>
            </xs:complexType>
         </xs:element>
      </xs:schema>
   </wsdl:types>
   <wsdl:message name="CheckPreviousEmploymentRequest">
      <wsdl:part name="parameters" element="ns:CheckPreviousEmployment" />
   </wsdl:message>
   <wsdl:message name="CheckPreviousEmploymentResponse">
      <wsdl:part name="parameters" element="ns:CheckPreviousEmploymentResponse" />
   </wsdl:message>
   <wsdl:portType name="PreviousEmploymentPortType">
      <wsdl:operation name="CheckPreviousEmployment">
         <wsdl:input message="ns:CheckPreviousEmploymentRequest"
            wsaw:Action="urn:CheckPreviousEmployment" />
         <wsdl:output message="ns:CheckPreviousEmploymentResponse"
            wsaw:Action="urn:CheckPreviousEmploymentResponse" />
      </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="PreviousEmploymentSoap11Binding" type="ns:PreviousEmploymentPortType">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
         style="document" />
      <wsdl:operation name="CheckPreviousEmployment">
         <soap:operation soapAction="urn:CheckPreviousEmployment"
            style="document" />
         <wsdl:input>
            <soap:body use="literal" />
         </wsdl:input>
         <wsdl:output>
            <soap:body use="literal" />
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:binding name="PreviousEmploymentSoap12Binding" type="ns:PreviousEmploymentPortType">
      <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
         style="document" />
      <wsdl:operation name="CheckPreviousEmployment">
         <soap12:operation soapAction="urn:CheckPreviousEmployment"
            style="document" />
         <wsdl:input>
            <soap12:body use="literal" />
         </wsdl:input>
         <wsdl:output>
            <soap12:body use="literal" />
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:binding name="PreviousEmploymentHttpBinding" type="ns:PreviousEmploymentPortType">
      <http:binding verb="POST" />
      <wsdl:operation name="CheckPreviousEmployment">
         <http:operation location="CheckPreviousEmployment" />
         <wsdl:input>
            <mime:content type="text/xml" part="parameters" />
         </wsdl:input>
         <wsdl:output>
            <mime:content type="text/xml" part="parameters" />
         </wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="PreviousEmployment">
      <wsdl:port name="PreviousEmploymentHttpSoap11Endpoint"
         binding="ns:PreviousEmploymentSoap11Binding">
         <soap:address
            location="http://localhost:9090/PrevEmploymentCheckService/services/PreviousEmployment.PreviousEmploymentHttpSoap11Endpoint/" />
      </wsdl:port>
      <wsdl:port name="PreviousEmploymentHttpSoap12Endpoint"
         binding="ns:PreviousEmploymentSoap12Binding">
         <soap12:address
            location="http://localhost:9090/PrevEmploymentCheckService/services/PreviousEmployment.PreviousEmploymentHttpSoap12Endpoint/" />
      </wsdl:port>
      <wsdl:port name="PreviousEmploymentHttpEndpoint" binding="ns:PreviousEmploymentHttpBinding">
         <http:address
            location="http://localhost:9090/PrevEmploymentCheckService/services/PreviousEmployment.PreviousEmploymentHttpEndpoint/" />
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>

The Java client that can access the Web Service is"

package com.argo;

import java.rmi.RemoteException;

public class PrevEmploymentCheckClient2
{
   public static void main(String[] args)
   {
      try
      {
         PreviousEmploymentStub theStub = new PreviousEmploymentStub();
         CheckPreviousEmployment cpe = new CheckPreviousEmployment();
         
         cpe.setApplicantName("BarryBlack-From Client2");
         
         String emplymntHistory = new String();
         
         CheckPreviousEmploymentResponse theResp =
                        theStub.checkPreviousEmployment(cpe);
         
         emplymntHistory = theResp.get_return();
         
         System.out.println("PrevEmploymentCheckClient2.main() found "
                     + "emplymntHistory = \""
                     + emplymntHistory
                     + "\".");
      
      }
      catch(AxisFault af)
      {
         af.printStackTrace();
      }
      catch(RemoteException re)
      {
         re.printStackTrace();
      }
   }

}

Outcomes