Premature end of file

i have a error , always can’t resolve,this is my deploy xml file:

<?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:flowable="http://flowable.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"     xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="travelReimburseApply">
  <process id="Apply_1154667969863999490" name="apply" isExecutable="true">
<startEvent id="StartEvent" name="begin" flowable:initiator="createEmployee" />
<userTask id="Initiator" name="be" flowable:formKey="Apply" flowable:assignee="${createEmployee}" flowable:formFieldValidation="true" />
<userTask id="Approver_20191021150815" name="arr" flowable:assignee="${Approver_20191021150815}">
  <documentation></documentation>
  <extensionElements>
    <flowable:taskListener delegateExpression="transferSupervisor" event="create" />
  </extensionElements>
</userTask>
<sequenceFlow id="SequenceFlow_20191021150811" sourceRef="Initiator" targetRef="Approver_20191021150815" />
<userTask id="Finance_20191021150815" name="gzfd" flowable:assignee="${Finance_20191021150815}">
  <documentation></documentation>
  <extensionElements>
    <flowable:taskListener delegateExpression="transferBoss" event="create" />
  </extensionElements>
</userTask>
<sequenceFlow id="SequenceFlow_20191021150812" sourceRef="Approver_20191021150815" targetRef="Finance_20191021150815" />
<userTask id="Cashier_20191021150815" name="ljhljkl" flowable:assignee="${Cashier_20191021150815}">
  <documentation></documentation>
</userTask>
<sequenceFlow id="SequenceFlow_20191021150813" sourceRef="Finance_20191021150815" targetRef="Cashier_20191021150815" />
<endEvent id="EndEvent" name="end" />
<sequenceFlow id="SequenceFlow_20191021150814" sourceRef="Cashier_20191021150815" 
targetRef="EndEvent" />
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_Apply">
<bpmndi:BPMNPlane id="BPMNPlane_Apply" bpmnElement="Apply_1154667969863999490">
  <bpmndi:BPMNShape id="BPMNShape_StartEvent" bpmnElement="StartEvent">
    <omgdc:Bounds x="-115" y="163" width="30" height="30" />
    <bpmndi:BPMNLabel>
      <omgdc:Bounds x="-111" y="193" width="22" height="14" />
    </bpmndi:BPMNLabel>
  </bpmndi:BPMNShape>
  <bpmndi:BPMNShape id="BPMNShape_Initiator" bpmnElement="Initiator">
    <omgdc:Bounds x="255" y="138" width="100" height="80" />
  </bpmndi:BPMNShape>
  <bpmndi:BPMNShape id="BPMNShape_Approver_20191021150815" bpmnElement="Approver_20191021150815">
    <omgdc:Bounds x="450" y="138" width="100" height="80" />
  </bpmndi:BPMNShape>
  <bpmndi:BPMNShape id="BPMNShape_Finance_20191021150815" bpmnElement="Finance_20191021150815">
    <omgdc:Bounds x="660" y="138" width="100" height="80" />
  </bpmndi:BPMNShape>
  <bpmndi:BPMNShape id="BPMNShape_Cashier_20191021150815" bpmnElement="Cashier_20191021150815">
    <omgdc:Bounds x="840" y="138" width="100" height="80" />
  </bpmndi:BPMNShape>
  <bpmndi:BPMNShape id="BPMNShape_EndEvent" bpmnElement="EndEvent">
    <omgdc:Bounds x="1020" y="164" width="28" height="28" />
  </bpmndi:BPMNShape>
  <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_20191021150811" bpmnElement="SequenceFlow_20191021150811">
    <omgdi:waypoint x="355" y="178" />
    <omgdi:waypoint x="450" y="178" />
  </bpmndi:BPMNEdge>
  <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_20191021150814" bpmnElement="SequenceFlow_20191021150814">
    <omgdi:waypoint x="940" y="178" />
    <omgdi:waypoint x="1020" y="178" />
  </bpmndi:BPMNEdge>
  <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_20191021150812" bpmnElement="SequenceFlow_20191021150812">
    <omgdi:waypoint x="550" y="178" />
    <omgdi:waypoint x="660" y="178" />
  </bpmndi:BPMNEdge>
  <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_20191021150813" bpmnElement="SequenceFlow_20191021150813">
    <omgdi:waypoint x="760" y="178" />
    <omgdi:waypoint x="840" y="178" />
  </bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
 </bpmndi:BPMNDiagram>
</definitions>

when i use requst.getInputStream(); get a inputStream, and ready validate bpmn ,
InputStreamProvider inputStreamProvider = new InputStreamSource(inputStream);
BpmnModel bpmnModel =
bpmnXMLConverter.convertToBpmnModel(inputStreamProvider, true, false, “UTF-8”);
it will has a error org.xml.sax.SAXParseException: Premature end of file. so, i m search in intent however ,it can’t resolve my question, asf for you

If I save your xml file out as “4772.bpmn20.xml” this unit test completes successfully:

@Test
public void my4772() {
    BpmnXMLConverter bpmnXMLConverter = new BpmnXMLConverter();
    InputStream xmlStream = this.getClass().getClassLoader().getResourceAsStream("4772.bpmn20.xml");
    StreamSource xmlSource = new InputStreamSource(xmlStream);
    BpmnModel bpmnModel =
        bpmnXMLConverter.convertToBpmnModel(xmlSource, true, false, "UTF-8");
    System.out.println("bpmnModel: " + bpmnModel);
}

Hope this helps.

Thanks your reply, in the end i find request.getInputStream will lead to the file “Premature end of file”, so when i remove this code , it’s really deploy successfull , i can only use transint to manage my deployment . thank you again.