Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

CustomSqlChange for one type of db was compiled for another ones too

$
0
0
In my liquibase project I created changeset for Oracle db (dbms = "oracle" in xml file) generated by CustomSqlChange java class. It could be successfully applied directly to my db. But in my main spring project I use SpringLiquibase for repository tests (DBUnit). Such tests use H2 db, and so on CI pipeline only my h2 liquibase changesets are applied.
The problem is that oracle changeset with customSqlChange falls down in CI due to
Caused by: liquibase.exception.CustomChangeException: java.lang.ClassNotFoundException:
  1. ....
  2. 11:33:20 [error]     at liquibase.change.custom.CustomChangeWrapper.setClass(CustomChangeWrapper.java:96)
  3. 11:33:20 [error]     at liquibase.change.custom.CustomChangeWrapper.load(CustomChangeWrapper.java:293)
  4. 11:33:20 [error]     ... 77 more
  5. 11:33:20 [error] Caused by: java.lang.ClassNotFoundException: com.myClassForCustomSqlChange
  6. 11:33:20 [error]     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
  7. 11:33:20 [error]     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  8. 11:33:20 [error]     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  9. 11:33:20 [error]     at java.lang.Class.forName0(Native Method)
  10. 11:33:20 [error]     at java.lang.Class.forName(Class.java:348)
  11. 11:33:20 [error]     at liquibase.change.custom.CustomChangeWrapper.setClass(CustomChangeWrapper.java:87)
  12. 11:33:20 [error]     ... 78 more
  13. ....
So, even changeset is created for oracle, liquibase is trying to compile customSqlChange java file for H2. It is strange because it shouldn't be used by h2 db. So can you propose some effective solutions for this issue?

P.S. just a piece of code in my spring configuration for liquibase run:
  1. @Bean
    public SpringLiquibase springLiquibase(@Named(value = "dataSource") DataSource dataSource) {
    SpringLiquibase springLiquibase = new SpringLiquibase();
    springLiquibase.setDataSource(dataSource);
    springLiquibase.setChangeLog(DB_CHANGELOG_MASTER_FILE);
    springLiquibase.setIgnoreClasspathPrefix(true);
    springLiquibase.setResourceLoader(new PathMatchingResourcePatternResolver());
    return springLiquibase;
    }



Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>