Java.lang.IllegalStateException: Bean factory must be an instance of ListableBeanFactory, null

I create the state machine object using the provided builder as follows:

10.2 State Machine via Builder

I see the following exception:

ERROR org.springframework.statemachine.support.StateMachineObjectSupport - cannot annotate annotation handlers java.lang.IllegalStateException: Bean factory must be an instance of ListableBeanFactory, was null

The exception does not interfere with the operation of the state machine as expected. However, I would like to talk about why I see this.

Does anyone know how I can stop this exception?

Thank.

+4
source share
2

.

Spring . AutowireCapableBeanFactory . :

   @Autowired
    private ApplicationContext appContext;

     private void buildStateMachine() throws Exception {
        Builder<EnquiryStatus, Event> builder = StateMachineBuilder.builder();
        builder.configureConfiguration().withConfiguration().beanFactory(appContext.getAutowireCapableBeanFactory());
     }
+4

:

builder.configureConfiguration().withConfiguration().beanFactory(new StaticListableBeanFactory());
+1

All Articles