# Deployment: addClasspathResource works, addString/addInputStream etc, not

**URL:** <https://forum.flowable.org/t/deployment-addclasspathresource-works-addstring-addinputstream-etc-not/12287>\
**Category:** Uncategorized\
**Created:** [June 11, 2025, 7:01am UTC](https://forum.flowable.org/t/deployment-addclasspathresource-works-addstring-addinputstream-etc-not/12287 "2025-06-11T07:01:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.burger](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@michael.burger](https://forum.flowable.org/u/michael.burger)\
**Post date:** [June 11, 2025, 7:01am UTC](https://forum.flowable.org/t/deployment-addclasspathresource-works-addstring-addinputstream-etc-not/12287/1 "2025-06-11T07:01:04Z")

</div>

I am using Java 21 and Flowable 7.1.0. I created a small BPMN with bpmn-io and tried to add the flowable extensions for execution with a code-generator.  
Then I tried to deploy the resulting String in a flowable process engine (addString).  
There is no error, when calling “deploy()” but

```auto
        ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
                .deploymentId(deployment.getId())
                .singleResult();
        log.info("Found process definition : {}", processDefinition.getName());

```

fails with a Null Pointer Exception.

When I copy the string to an XML File, place it in src/main/resource everything works fine.  
I tried to:

- Convert String to byte with Charset-UTF8 and use addBytes() → Same null pointer
- Convert String to a File, instantiating an inputStream on it and use addInputStream() → Same null pointer

I extracted the problem to a minimal working example:

> **[GitHub - michaelburger84/flowable-minimal: For...](https://github.com/michaelburger84/flowable-minimal/tree/main)**
>
> main

[flowable-getting-started.zip](https://www.file-upload.net/download-15506534/flowable-getting-started.zip.html)

Here is the XML Content of the file  
`<?xml version="1.0" encoding="UTF-8" standalone="no"?><definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:flowable="http://flowable.org/bpmn" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exporter="bpmn-js (https://demo.bpmn.io)" exporterVersion="18.6.1" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn"><process id="Process_1" isExecutable="true" name="Hello World Process"><startEvent id="StartEvent_1y45yut" name="hunger noticed"><outgoing>SequenceFlow_0h21x7r</outgoing></startEvent><sequenceFlow id="SequenceFlow_0h21x7r" sourceRef="StartEvent_1y45yut" targetRef="Task_1hcentk"/><serviceTask flowable:class="org.flowable.examples.task.HelloWorldDelegate" id="Task_1hcentk" name="choose recipe"><incoming>SequenceFlow_0h21x7r</incoming><outgoing>Flow_1kfubm7</outgoing></serviceTask><endEvent id="Event_1sfoqr3"><incoming>Flow_1kfubm7</incoming></endEvent><sequenceFlow id="Flow_1kfubm7" sourceRef="Task_1hcentk" targetRef="Event_1sfoqr3"/></process><bpmndi:BPMNDiagram id="BpmnDiagram_1"><bpmndi:BPMNPlane bpmnElement="Process_1" id="BpmnPlane_1"><bpmndi:BPMNShape bpmnElement="StartEvent_1y45yut" id="StartEvent_1y45yut_di"><omgdc:Bounds height="36" width="36" x="152" y="102"/><bpmndi:BPMNLabel><omgdc:Bounds height="14" width="73" x="134" y="145"/></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="Task_1hcentk" id="Activity_18hidv9_di"><omgdc:Bounds height="80" width="100" x="240" y="80"/></bpmndi:BPMNShape><bpmndi:BPMNShape bpmnElement="Event_1sfoqr3" id="Event_1sfoqr3_di"><omgdc:Bounds height="36" width="36" x="392" y="102"/></bpmndi:BPMNShape><bpmndi:BPMNEdge bpmnElement="SequenceFlow_0h21x7r" id="SequenceFlow_0h21x7r_di"><omgdi:waypoint x="188" y="120"/><omgdi:waypoint x="240" y="120"/></bpmndi:BPMNEdge><bpmndi:BPMNEdge bpmnElement="Flow_1kfubm7" id="Flow_1kfubm7_di"><omgdi:waypoint x="340" y="120"/><omgdi:waypoint x="392" y="120"/></bpmndi:BPMNEdge></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></definitions>`

Can you see, what I am doing wrong? And why does the deploy() and validation behind it not result in any errors?  
Thanks in advance and kind regards,  
Michael

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [June 11, 2025, 7:05am UTC](https://forum.flowable.org/t/deployment-addclasspathresource-works-addstring-addinputstream-etc-not/12287/2 "2025-06-11T07:05:33Z")

</div>

Hey @michael.burger,

> [@michael.burger](#):
>
> I extracted the problem to a minimal working example:  
> [flowable-getting-started.zip](https://www.file-upload.net/download-15506534/flowable-getting-started.zip.html)

Can you please create a GitHub repo instead of a zip file like this?

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![michael.burger](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@michael.burger](https://forum.flowable.org/u/michael.burger)\
**Post date:** [June 11, 2025, 7:21am UTC](https://forum.flowable.org/t/deployment-addclasspathresource-works-addstring-addinputstream-etc-not/12287/3 "2025-06-11T07:21:46Z")

</div>

I did it here:

> **[GitHub - michaelburger84/flowable-minimal: For...](https://github.com/michaelburger84/flowable-minimal/tree/main)**
>
> main

Also I think its much more complicated for everyone compared to downloading a 10kb zip and extracting it…  
Regards,  
Michael

---

<div class="post-metadata">

**Author:** ![filiphr](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/filiphr/32/315_2.png) [@filiphr](https://forum.flowable.org/u/filiphr)\
**Post date:** [June 11, 2025, 9:29am UTC](https://forum.flowable.org/t/deployment-addclasspathresource-works-addstring-addinputstream-etc-not/12287/4 "2025-06-11T09:29:34Z")

</div>

Thanks @michael.burger,

> [@michael.burger](#):
>
> Also I think its much more complicated for everyone compared to downloading a 10kb zip and extracting it…

However, it is less secure.

Anyways, I had a look at it. You are doing

```auto
.addString("user.xml", text)

```

The problem is that we do not know what this `xml` extension is. So what you need to do is to either make sure that it ends with `.bpmn20.xml` or `.bpmn`. When I change it to some of that then it works properly. i.e. the `ProcessDefinition` is there, it fails on something else down the line.

The `addClasspathResource` works because your resource name ends with `.bpmn`.

Cheers,  
Filip

---

<div class="post-metadata">

**Author:** ![michael.burger](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@michael.burger](https://forum.flowable.org/u/michael.burger)\
**Post date:** [June 11, 2025, 10:42am UTC](https://forum.flowable.org/t/deployment-addclasspathresource-works-addstring-addinputstream-etc-not/12287/5 "2025-06-11T10:42:33Z")

</div>

Thanks. This works. The process is deployed and I can query it.
