Hi all,
I downloaded 7.7.0, activated the authentication filter in the rest-engine webapp and started the application. Now I’m trying to deploy [1] a simple model (see attachment) over the REST API but I’m getting an NPE [3]. What am I doing wrong?
[1]
String plainCreds = "demo:demo";
byte[] plainCredsBytes = plainCreds.getBytes();
byte[] base64CredsBytes = Base64.getEncoder().encode(plainCredsBytes);
String base64Creds = new String(base64CredsBytes);
HttpHeaders headers = new HttpHeaders();
headers.add("Authorization", "Basic " + base64Creds);
headers.add("Host", "localhost:8080");
headers.add("Accept", "application/json");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
InputStream in = getClass().getResourceAsStream("/test.bpmn");
IOUtils.copy(in, baos);
ByteArrayResource bar = new ByteArrayResource(baos.toByteArray(),"test.pbmn");
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
RestTemplate restTemplate = new RestTemplate();
MultiValueMap<String, Object> parts = new LinkedMultiValueMap<String, Object>();
parts.add("deployment-name", "test.bpmn");
parts.add("deployment-source", "test.bpmn");
parts.add("enable-duplicate-filtering", "true");
parts.add("deployment-name", "test-deployment");
//parts.add("tenant-id", "camunda-admin");
parts.add("data", bar);
HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<>(parts, headers);
try{
String result = restTemplate.postForObject(
"http://localhost:8080/engine-rest/deployment/create", request, String.class);
System.out.println(result);
}
catch (HttpServerErrorException e){
System.err.println(e.getResponseBodyAsString());
}
[3]
java.lang.NullPointerException
org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.isResourceHandled(AbstractDefinitionDeployer.java:81)
org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.parseDefinitionResources(AbstractDefinitionDeployer.java:70)
org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.deploy(AbstractDefinitionDeployer.java:61)
org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer$1.call(CacheDeployer.java:50)
org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer$1.call(CacheDeployer.java:47)
org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:473)
org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer.deploy(CacheDeployer.java:47)
org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache.deploy(DeploymentCache.java:63)
org.camunda.bpm.engine.impl.persistence.entity.DeploymentManager.insertDeployment(DeploymentManager.java:51)
org.camunda.bpm.engine.impl.cmd.DeployCmd.deploy(DeployCmd.java:479)
org.camunda.bpm.engine.impl.cmd.DeployCmd$1.call(DeployCmd.java:138)
org.camunda.bpm.engine.impl.cmd.DeployCmd$1.call(DeployCmd.java:126)
test.bpmn (4.1 KB)