Fix class loading in StateMachineConfiguration

- Change used classloader so that classes in found if
  doing normal boot cli tricks for a sm config adapter.
- Fixes #122
This commit is contained in:
Janne Valkealahti
2015-11-26 08:17:51 +00:00
parent 01dc737bf6
commit b5d3c4e3e4

View File

@@ -62,8 +62,9 @@ public class StateMachineConfiguration<S, E> extends
Class<? extends Annotation> namedAnnotation) throws Exception {
String enableStateMachineEnclosingClassName = importingClassMetadata.getClassName();
// for below classloader, see gh122
Class<?> enableStateMachineEnclosingClass = ClassUtils.forName(enableStateMachineEnclosingClassName,
getClass().getClassLoader());
ClassUtils.getDefaultClassLoader());
// return null if it looks like @EnableStateMachine was annotated with class
// not extending StateMachineConfigurer.
if (!ClassUtils.isAssignable(StateMachineConfigurer.class, enableStateMachineEnclosingClass)) {