codecentric / chaos-monkey-spring-boot

Chaos Monkey for Spring Boot
https://codecentric.github.io/chaos-monkey-spring-boot/
Apache License 2.0
910 stars 170 forks source link

NullPointerException when fetching from Spring Cloud Config with active Chaos Monkey profile #472

Closed WorldFam closed 5 months ago

WorldFam commented 5 months ago

Issue

Hello,

I am currently experiencing an issue with Chaos Monkey for Spring Boot. When I have the chaos-monkey profile active and try to fetch from Spring Cloud Config, I receive a NullPointerException.

Here is the error message: java.lang.NullPointerException: Cannot invoke "org.example.LabelProperties.getLabel(org.example.LabelType, int)" because "this.properties" is null at org.example.PaymentChannelService.toEntity(PaymentChannelService.java:26) ~[classes/:na] ... The error seems to occur when the PaymentChannelService tries to convert to an entity. It appears that this.properties is null, which leads to the NullPointerException.

This issue only occurs when the chaos-monkey profile is active. When I remove the profile, everything works as expected.

Context (Environment)

Spring Boot: 3.2.5 Chaos Monkey for Spring Boot: 3.1.0

WorldFam commented 5 months ago

Needed to exclude class from being scanned