cancel
Showing results for 
Search instead for 
Did you mean: 

Error Parsing XML

chadwyck
Champ in-the-making
Champ in-the-making
Hello,

I am using 5.13 and trying to make an Upload Deployment rest API post including my .bar file, and I continue to get a 500 error, "Error parsing XML".  I've tried using several rest clients to do this, including cURL and Postman, and all give me the same error.  I've tried uploading the straight .bpmn file as well, with the same result.

This is my cURL call:

curl –basic –user kermit:kermit –form "fileupload=@testProcess.bar" http://localhost:8080/activiti-rest/service/deployment


All other rest calls except for uploading seem to work just fine.  I'm rather new to Activiti, so it's probably a simple error that I'm making.  Can anyone see what I'm doing wrong?
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor

if (fileName.endsWith(".bpmn20.xml") || fileName.endsWith(".bpmn")) {
        deploymentBuilder.addInputStream(fileName, uploadItem.getInputStream());
      } else if (fileName.toLowerCase().endsWith(".bar") || fileName.toLowerCase().endsWith(".zip")) {
        deploymentBuilder.addZipInputStream(new ZipInputStream(uploadItem.getInputStream()));
      } else {
        throw new ActivitiIllegalArgumentException("File must be of type .bpmn20.xml, .bpmn, .bar or .zip");
      }

You're sure the file you're uploading is a ZIP-file? Also, are you sure the XML file (bpmn) is actually valid XML to start with? We have a test for this behavior, perhaps you can try that with you're file to be sure it's not the client you're using. See https://github.com/Activiti/Activiti/blob/847e5bf49237211c1744ff9f46786397bddab3db/modules/activiti-...

Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.