Skip to content

Handle null BeanFactory in StateMachineHandlerCallHelper #412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
java-artisan opened this issue Sep 15, 2017 · 2 comments
Closed

Handle null BeanFactory in StateMachineHandlerCallHelper #412

java-artisan opened this issue Sep 15, 2017 · 2 comments
Labels
type/enhancement Is an enhancement request
Milestone

Comments

@java-artisan
Copy link

I am using the StateMachineBuilder to create ad-hoc state machines. It is apparently a known issue. However, the proposed solutions don't seem to work.

final StateMachineBuilder.Builder<States, Events> builder = StateMachineBuilder.builder();
// doesn't work
builder.configureConfiguration().withConfiguration().beanFactory(new StaticListableBeanFactory());

// doesn't work either    
builder.configureConfiguration().withConfiguration().beanFactory(applicationContext.getAutowireCapableBeanFactory());

This happens regardless using a persister. Is there anything else I can try ?

System configuration:

  • Linux amd64
  • JDK 1.8.0_144
  • Spring 4.3.11.RELEASE
  • Spring SSM 1.2.6.RELEASE
@jvalkeal
Copy link
Contributor

I'm finally going to take away that annoying warning message and handle that exception as this mess dates to times when we didn't have builders, thus more change of working outside of spring context.

@jvalkeal jvalkeal added the type/enhancement Is an enhancement request label Nov 10, 2017
@jvalkeal jvalkeal added this to the 1.2.7.RELEASE milestone Nov 10, 2017
@jvalkeal jvalkeal changed the title Can not get rid of 'java.lang.IllegalStateException: Bean factory must be instance of ListableBeanFactory, was null' Handle null BeanFactory in StateMachineHandlerCallHelper Nov 12, 2017
jvalkeal added a commit to jvalkeal/spring-statemachine that referenced this issue Nov 12, 2017
- Makes things less chatty if BeanFactory is null in
  StateMachineHandlerCallHelper as this is usually a case
  with manual builders outside of app context.
- Fixes spring-projects#412
@jvalkeal
Copy link
Contributor

Merged per c8062e6

jvalkeal added a commit that referenced this issue Nov 12, 2017
- Makes things less chatty if BeanFactory is null in
  StateMachineHandlerCallHelper as this is usually a case
  with manual builders outside of app context.
- Backport #412
- Relates #307
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Is an enhancement request
Projects
None yet
Development

No branches or pull requests

2 participants