camunda / camunda-bpm-platform

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.
https://camunda.com/
Apache License 2.0
4.13k stars 1.56k forks source link

ApplicationContext destroyed when setting ProcessVariable on bean initialization #4787

Closed LinusHojaGER closed 1 week ago

LinusHojaGER commented 1 week ago

Environment

Description

If create a Class extending ProcessVariable, calling super() in the constructor and setting the Variable Value right after the super() call by using set(VALUE), the ApplicationContext isnt working afterwards. For every call to the ApplicationContext, a NPE is thrown.

Steps to reproduce

  1. Create a Class extending ProcessVariable
  2. Call super() in the overridden Constructor
  3. Call set(0) rigth after the super() call
  4. Try to startup the Application

Observed Behavior

On every (also implicit) call to the ApplicationContext, e.g. bean initialization, a NullPointerException is thrown. The ApplicationContext is unusable.

Expected behavior

A more thought thru ErrorHandling should be implemented to

  1. prevent camunda from crashing the whole Spring ApplicationContext
  2. give the user a more describing error, why this is not working.

Root Cause (Required on prioritization)

Solution Ideas

Hints

Links

Breakdown

### Pull Requests

Dev2QA handover

LinusHojaGER commented 1 week ago

I just noticed that we are using wrapper classes that induce this behavior. No Issue from camunda as i can see so far.