holunda-io / camunda-bpm-taskpool

Library for pooling user tasks and process related business objects.
https://www.holunda.io/camunda-bpm-taskpool/
Apache License 2.0
66 stars 26 forks source link

ApplicationNameBeanPostProcessor cannot access private properties #908

Closed stefanzilske closed 8 months ago

stefanzilske commented 8 months ago

Steps to reproduce

I have an application, which uses io.axoniq.console:console-framework-client-spring-boot-starter alongside Polyflow. The axon library contains a ConfigurationProperties class, which has a private applicationName property.

When I start the SpringBoot app, ApplicationNameBeanPostProcessor tries to access the applicationName property, but fails:

Caused by: kotlin.reflect.full.IllegalCallableAccessException: java.lang.IllegalAccessException: class kotlin.reflect.jvm.internal.calls.CallerImpl$FieldGetter cannot access a member of class io.axoniq.console.framework.starter.AxoniqConsoleSpringProperties with modifiers "private"
  at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:280)
  at kotlin.reflect.jvm.internal.KProperty1Impl.get(KProperty1Impl.kt:35)
  at io.holunda.polyflow.spring.ApplicationNameBeanPostProcessor.postProcessAfterInitialization(ApplicationNameBeanPostProcessor.kt:29)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:434)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1773)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598)
  ... 116 common frames omitted
Caused by: java.lang.IllegalAccessException: class kotlin.reflect.jvm.internal.calls.CallerImpl$FieldGetter cannot access a member of class io.axoniq.console.framework.starter.AxoniqConsoleSpringProperties with modifiers "private"
  at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:392)
  at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:674)
  at java.base/java.lang.reflect.Field.checkAccess(Field.java:1102)
  at java.base/java.lang.reflect.Field.get(Field.java:423)
  at kotlin.reflect.jvm.internal.calls.CallerImpl$FieldGetter.call(CallerImpl.kt:176)
  at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:108)
  ... 121 common frames omitted
zambrovski commented 8 months ago

Currently, the processor is doing too much... I limited it to certain candidates, this should fix the problem.