org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [sk/trilobit/eskn/cskn/config/DatabaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'sequence/'

Stack Overflow | Trilobitak | 4 months ago
  1. 0

    Maven - Spring - Liquibase includeAll not work

    Stack Overflow | 4 months ago | Trilobitak
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [sk/trilobit/eskn/cskn/config/DatabaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'sequence/'
  2. 0

    If we call liquibase.update() from an application, we got an exception. {noformat} liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:27) at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:215) at liquibase.Liquibase.update(Liquibase.java:192) at liquibase.Liquibase.update(Liquibase.java:181) at liquibase.Liquibase.update(Liquibase.java:174) at de.ids.en.client.integrationtests3.test.AbstractLiquiBasedTestHelper.setUpDatabase(AbstractLiquiBasedTestHelper.java:37) at de.ids.en.client.integrationtests3.test.GenericEntityTemplateTest.setUp(GenericEntityTemplateTest.java:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: liquibase.exception.SetupException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:247) at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:211) at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25) ... 30 more Caused by: liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:27) at liquibase.changelog.DatabaseChangeLog.include(DatabaseChangeLog.java:353) at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:245) ... 32 more Caused by: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:331) at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:261) at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:211) at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25) ... 34 more Caused by: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:324) ... 37 more {noformat} That is our call: {noformat} ResourceAccessor resourceAccessor = new ClassLoaderResourceAccessor(); Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(conn)); Liquibase liquibase = new Liquibase(liquibaseFile, resourceAccessor, database); liquibase.update(""); {noformat} And this is our workaround: {noformat} ResourceAccessor resourceAccessor = new ClassLoaderResourceAccessor() { @Override public Set<String> list(String relativeTo, String path, boolean includeFiles, boolean includeDirectories, boolean recursive) throws IOException { relativeTo = FilenameUtils.getFullPath(relativeTo); return super.list(relativeTo, path, includeFiles, includeDirectories, recursive); } }; Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(conn)); Liquibase liquibase = new Liquibase(liquibaseFile, resourceAccessor, database); liquibase.update(""); {noformat} The Problem is the path won't correct created.

    JIRA | 2 years ago | idsettlingen
    liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/'
  3. 0

    If we call liquibase.update() from an application, we got an exception. {noformat} liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:27) at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:215) at liquibase.Liquibase.update(Liquibase.java:192) at liquibase.Liquibase.update(Liquibase.java:181) at liquibase.Liquibase.update(Liquibase.java:174) at de.ids.en.client.integrationtests3.test.AbstractLiquiBasedTestHelper.setUpDatabase(AbstractLiquiBasedTestHelper.java:37) at de.ids.en.client.integrationtests3.test.GenericEntityTemplateTest.setUp(GenericEntityTemplateTest.java:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: liquibase.exception.SetupException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:247) at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:211) at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25) ... 30 more Caused by: liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:27) at liquibase.changelog.DatabaseChangeLog.include(DatabaseChangeLog.java:353) at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:245) ... 32 more Caused by: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:331) at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:261) at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:211) at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25) ... 34 more Caused by: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/' at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:324) ... 37 more {noformat} That is our call: {noformat} ResourceAccessor resourceAccessor = new ClassLoaderResourceAccessor(); Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(conn)); Liquibase liquibase = new Liquibase(liquibaseFile, resourceAccessor, database); liquibase.update(""); {noformat} And this is our workaround: {noformat} ResourceAccessor resourceAccessor = new ClassLoaderResourceAccessor() { @Override public Set<String> list(String relativeTo, String path, boolean includeFiles, boolean includeDirectories, boolean recursive) throws IOException { relativeTo = FilenameUtils.getFullPath(relativeTo); return super.list(relativeTo, path, includeFiles, includeDirectories, recursive); } }; Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(conn)); Liquibase liquibase = new Liquibase(liquibaseFile, resourceAccessor, database); liquibase.update(""); {noformat} The Problem is the path won't correct created.

    JIRA | 2 years ago | idsettlingen
    liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'tables/'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. liquibase.exception.SetupException

      Could not find directory or directory was empty for includeAll 'sequence/'

      at liquibase.changelog.DatabaseChangeLog.includeAll()
    2. Liquibase Core
      SpringLiquibase.afterPropertiesSet
      1. liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:438)
      2. liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:349)
      3. liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:282)
      4. liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25)
      5. liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:229)
      6. liquibase.Liquibase.update(Liquibase.java:202)
      7. liquibase.Liquibase.update(Liquibase.java:192)
      8. liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:434)
      9. liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:391)
      9 frames
    3. Spring Beans
      AbstractBeanFactory.getBean
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
      5. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
      6. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      7. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
      8. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
      9. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:295)
      10. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
      10 frames
    4. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1045)
      2. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:824)
      3. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
      3 frames
    5. Spring Boot
      SpringApplication.run
      1. org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:117)
      2. org.springframework.boot.SpringApplication.refresh(SpringApplication.java:689)
      3. org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
      3 frames
    6. sk.trilobit.eskn
      Application.main
      1. sk.trilobit.eskn.cskn.Application.main(Application.java:90)
      1 frame