Liquibase lib upgrade to 4.21.1 breaking code base previous working with 4.8.0

Hi Team,

Recently we had updated the liquibase library from 4.8.0 to 4.21.1 and we are noticing the below issue when we are executing liquibase.update on a single changeset

Caused by: liquibase.exception.DatabaseException: Error creating configured table through liquibase, error liquibase.exception.ChangeLogParseException: The file /var/opt/SIU/tracing_data_15.xml was not found in the configured search path:
- /opt/SIU/plugins/com.hp.usage.migratedb_10.11.0/commons-text-1.10.0.jar
- /opt/SIU/plugins/com.hp.usage.migratedb_10.11.0/derbyclient-10.15.2.0.jar
- /opt/SIU/plugins/com.hp.usage.migratedb_10.11.0/extension-1.0.1-SNAPSHOT-patched.jar
- /opt/SIU/plugins/com.hp.usage.migratedb_10.11.0/liquibase-core-4.21.1.jar
- /opt/SIU/plugins/com.hp.usage.migratedb_10.11.0/migratedb.jar
- /opt/SIU/plugins/com.hp.usage.migratedb_10.11.0/opencsv-5.7.1.jar
- /opt/SIU/plugins/com.hp.usage.migratedb_10.11.0/timesten-types-1.0.1-SNAPSHOT-patched.jar

The code is simple liquibase.update below which used to work with earlier version of library

conn = _dataSource.getConnection();
Database database = DatabaseFactory
.getInstance()
.findCorrectDatabaseImplementation(new JdbcConnection(conn));
ResourceAccessor resourceAccessor = new StreamResourceAccessor(Files.readString(path));
liquibase = new Liquibase(tracingFilePath, resourceAccessor, database);
liquibase.validate();
liquibase.update(CONTEXT);

could you please help me to proceed?

Hi @sachin234s,

The versions starting 4.13 onward use a new approach for search path. Here’s the documentation:
https://contribute.liquibase.com/extensions-integrations/integration-guides/configure-file-access/#search-path

And here’s a code sample (also in the docs):

//set up ConfigurationValueProviders

Scope.child(Scope.Attr.resourceAccessor, new SearchPathResourceAccessor(), () → {
//Code in this lambda will use the new ResourceAccessor
});

Does that help?

-PJ