1

I can't run this

liquibase --driver=oracle.jdbc.OracleDriver --classpath=ojdbc8.jar --url="jdbc:oracle:thin:@host:port:sid" --changeLogFile=db.xml --username=name --password=psw generateChangeLog

I get an error

"Unexpected error running Liquibase: liquibase.exception.DatabaseException: java.sql.SQLException: Unsupported code table (add orai18n.jar to the class route): CL8MSWIN1251"

Full stack error

Liquibase Community 3.8.0 by Datical Unexpected error running Liquibase: liquibase.exception.DatabaseException: java.sql.SQLException: Неподдерживаемая кодовая таблица (добавьте orai18n.jar в маршрут классов): CL8MSWIN1251 liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: java.sql.SQLException: Неподдерживаемая кодовая таблица (добавьте orai18n.jar в маршрут классов): CL8MSWIN1251 at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:282) ~[liquibase.jar:na] at liquibase.integration.commandline.Main.doMigration(Main.java:1060) [liquibase.jar:na] at liquibase.integration.commandline.Main.run(Main.java:209) [liquibase.jar:na] at liquibase.integration.commandline.Main.main(Main.java:132) [liquibase.jar:na] Caused by: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: java.sql.SQLException: Неподдерживаемая кодовая таблица (добавьте orai18n.jar в маршрут классов): CL8MSWIN1251 at liquibase.command.AbstractCommand.execute(AbstractCommand.java:24) ~[liquibase.jar:na] at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:280) ~[liquibase.jar:na] ... 3 common frames omitted Caused by: liquibase.exception.DatabaseException: java.sql.SQLException: Неподдерживаемая кодовая таблица (добавьте orai18n.jar в маршрут классов): CL8MSWIN1251 at liquibase.snapshot.jvm.CatalogSnapshotGenerator.snapshotObject(CatalogSnapshotGenerator.java:47) ~[liquibase.jar:na] at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:66) ~[liquibase.jar:na] at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49) ~[liquibase.jar:na] at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:69) ~[liquibase.jar:na] at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49) ~[liquibase.jar:na] at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:315) ~[liquibase.jar:na] at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:100) ~[liquibase.jar:na] at liquibase.snapshot.DatabaseSnapshot.(DatabaseSnapshot.java:59) ~[liquibase.jar:na] at liquibase.snapshot.JdbcDatabaseSnapshot.(JdbcDatabaseSnapshot.java:39) ~[liquibase.jar:na] at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:217) ~[liquibase.jar:na] at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:190) ~[liquibase.jar:na] at liquibase.command.core.DiffCommand.createReferenceSnapshot(DiffCommand.java:221) ~[liquibase.jar:na] at liquibase.command.core.DiffCommand.createDiffResult(DiffCommand.java:143) ~[liquibase.jar:na] at liquibase.command.core.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:46) ~[liquibase.jar:na] at liquibase.command.AbstractCommand.execute(AbstractCommand.java:19) ~[liquibase.jar:na] ... 4 common frames omitted Caused by: java.sql.SQLException: Неподдерживаемая кодовая таблица (добавьте orai18n.jar в маршрут классов): CL8MSWIN1251 at oracle.sql.CharacterSetUnknown.failCharsetUnknown(CharacterSetFactoryThin.java:233) ~[ojdbc8.jar:19.3.0.0.0] at oracle.sql.CharacterSetUnknown.convert(CharacterSetFactoryThin.java:194) ~[ojdbc8.jar:19.3.0.0.0] at oracle.jdbc.driver.PhysicalConnection.throughDbCharset(PhysicalConnection.java:10365) ~[ojdbc8.jar:19.3.0.0.0] at oracle.jdbc.driver.PhysicalConnection.enquoteIdentifier(PhysicalConnection.java:10442) ~[ojdbc8.jar:19.3.0.0.0] at oracle.jdbc.driver.OracleStatement.enquoteIdentifier(OracleStatement.java:6452) ~[ojdbc8.jar:19.3.0.0.0] at oracle.jdbc.driver.OracleStatement.getColumnIndex(OracleStatement.java:3853) ~[ojdbc8.jar:19.3.0.0.0] at oracle.jdbc.driver.InsensitiveScrollableResultSet.findColumn(InsensitiveScrollableResultSet.java:270) ~[ojdbc8.jar:19.3.0.0.0] at oracle.jdbc.driver.GeneratedResultSet.getString(GeneratedResultSet.java:596) ~[ojdbc8.jar:19.3.0.0.0] at liquibase.snapshot.jvm.JdbcSnapshotGenerator.getDatabaseCatalogNames(JdbcSnapshotGenerator.java:149) ~[liquibase.jar:na] at liquibase.snapshot.jvm.CatalogSnapshotGenerator.snapshotObject(CatalogSnapshotGenerator.java:35) ~[liquibase.jar:na] ... 18 common frames omitte

How to fix this?

Timur
  • 23
  • 1
  • 5
  • Did you try `--classpath=ojdbc8.jar;orai18n.jar` –  Feb 17 '20 at 12:19
  • @a_horse_with_no_name it didn't work – Timur Feb 17 '20 at 14:23
  • Are you onj Windows or Linux? On Linux, the classpath separator is `:` The other option is to just put the driver jar and the `oai18n.jar` in the `/lib` directory. All jars in that directory are added the the classpath by the liquibase shell script. – SteveDonie Feb 17 '20 at 15:59
  • Also, it may be that the error is coming from the database side rather than the client side. I'd need to see a fuller stack trace to tell whether that was the case though. – SteveDonie Feb 17 '20 at 16:00
  • @SteveDonie I use Windows. I put all jar files in the /lib, but i also can't run command. I added full stack trace in main question – Timur Feb 18 '20 at 07:21
  • I really am not sure how to help here. It appears that your database is set up to use the bulgarian character encoding, `CL8MSWIN1251` and I don't know if Liquibase will even work with that. – SteveDonie Feb 18 '20 at 15:08
  • 1
    @SteveDonie i fix this problem. I changed NLS LANG in DB server. – Timur Feb 19 '20 at 09:17

2 Answers2

1

i fix this problem. I changed NLS LANG in DB server.

Timur
  • 23
  • 1
  • 5
1

Just add:

<dependency>
    <groupId>com.oracle.ojdbc</groupId>
    <artifactId>orai18n</artifactId>
    <version>19.3.0.0</version>
</dependency>
Daniil Baev
  • 69
  • 1
  • 8