Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

liquibase.exception.ChangeLogParseException: Error Reading Migration File: Found 2 files that match mychanges.xml

Tags:

java

liquibase

When i try and to start Liquibase via:

JdbcConnection liquibaseConnection = new JdbcConnection(connection);

Liquibase liquibase = new Liquibase("mychanges.xml", 
new ClassLoaderResourceAccessor(),liquibaseConnection);

liquibase.update("dev");

When it is going to update i get this exception

liquibase.exception.ChangeLogParseException: Error Reading Migration File: Found 2 files that match mychanges.xml

And is caused by:

Caused by: java.io.IOException: Found 2 files that match mychanges.xml

This seems strange because when i look in the war file it just contains one mychanges.xml

Ive tried renaming it and to move it to another location.

I do not understand why it is giving me this excepton. plees help

like image 811
Jeroen Avatar asked Nov 11 '16 16:11

Jeroen


2 Answers

I found it myself. The exception thrown was not correct. It actually meant that the file could not be found. Very strange exception for this case.

With this i found out that my classpath was kinda broken.

like image 169
Jeroen Avatar answered Oct 23 '22 05:10

Jeroen


In my case the folder path to the update sql file had non-ASCII characters in it (exp: éáű). Moving the update file into an ASCII only folder path worked.

This is with Liquibase 4.2.0 (2020-11-13 release).

[Rant]

Imagine supporting Unicode in 2020.

Liquibase team: nah

[/Rant]

like image 21
S0und Avatar answered Oct 23 '22 07:10

S0und