Skip to content
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

flowable-event-registry dependency on liquibase causes Spring Boot startup errors #2142

Closed
ilgrosso opened this issue Jan 24, 2020 · 6 comments

Comments

@ilgrosso
Copy link
Contributor

Due to this dependency https://github.com/flowable/flowable-engine/blob/master/modules/flowable-event-registry/pom.xml#L72-L75 I am receiving startup exceptions from my Spring Boot application:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.ChangeLogParseException: Error parsing classpath:/db/changelog/db.changelog-master.yaml
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.3.RELEASE.jar:5.2.3.RELEASE]
        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:339) ~[spring-context-5.2.3.RELEASE.jar:5.2.3.RELEASE]
@ilgrosso ilgrosso changed the title flowable-event-registry hard dependency on liquibase flowable-event-registry dependency on liquibase causes Spring Boot startup errors Jan 24, 2020
@filiphr
Copy link
Contributor

filiphr commented Jan 24, 2020

We have the FlowableLiquibaseEnvironmentPostProcessor.

So if you are using our starters you should not be seeing this problem. Are you using our autoconfiguration or not? If you are, then which Spring Boot version are you using?

How are you configuring your Spring Boot Application?

If you are not using our starters or autoconfiguration then you will need to manually disable the Spring Boot Liquibase property:

  • spring.liquibase.enabled on Spring Boot 2.x
  • liquibase.enabled on Spring Boot 1.x

@ilgrosso
Copy link
Contributor Author

Thanks for your answer.

Since Flowable is an optional module of Apache Syncope (the Spring Boot 2.2 application I am mentioning above) I would like to avoid "polluting" the main application.properties with specific properties as spring.liquibase.enabled, hence I decided to add the following bean definition to https://github.com/apache/syncope/blob/master/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/WorkflowFlowableContext.java:

    @Bean
    public SpringLiquibase liquibase() {
        SpringLiquibase liquibase = new SpringLiquibase();
        liquibase.setShouldRun(false);
        return liquibase;
    }

For the moment, it seems to work.

@filiphr
Copy link
Contributor

filiphr commented Jan 24, 2020

That's one option of doing it (this overrides the SpringLiquibase bean from Spring Boot).

You can also do something like the FlowableLiquibaseEnvironmentPostProcessor and set the property like we are doing. You can register that in the spring.factories of your flowable-bpmn module.

I am closing this issue now. If you think that there is something that we can do about it, please let us know.

@filiphr filiphr closed this as completed Jan 24, 2020
@filiphr
Copy link
Contributor

filiphr commented Jan 24, 2020

One other thing I forgot to add. If you are adding a bean then you would have to also add @AutoConfigureBefore(LiquibaseAutoConfiguration.class) in order to make sure that the bean from your WorkflowFlowableContext is scanned before the one from Spring Boot

@ilgrosso
Copy link
Contributor Author

Understood, thanks.
Not sure if you can add somewhere in the docs / upgrade guide the need of disabling Liquibase.

@ilgrosso
Copy link
Contributor Author

At the end I went through the FlowableLiquibaseEnvironmentPostProcessor path: apache/syncope@74f539b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants