I am attempting to implement a java triggered liquibase database update.
I have the following code:
java.sql.Connection connection = openConnection(eventContext);
Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(connection));
String changelog = UpgradePanDatabase.class.getResource("/liquibase/db.changelog.xml").getPath();
Liquibase liquibase = new liquibase.Liquibase(changelog, new ClassLoaderResourceAccessor(), database);
liquibase.update(new Contexts(), new LabelExpression());
connection.close();
but I receive the following ChangeLogParseException:
/Users/ntregillus/myApp/.mule/apps/myApp/classes/liquibase/db.changelog.xml does not exist
But I know the file exists, I can copy the path, and open it directly from the terminal, and also find it within the File Explorer. Why is Liquibase not able to find this file?
The most likely cause is that the changelog is not being packaged as a resource in the jar file. Check the structure of the packaged jar rather than your local developer working copy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With