1
votes

Machine:

Windows 10

java version "1.8.0_181" Java(TM) SE Runtime Environment (build 1.8.0_181-b13) Java HotSpot(TM) Client VM (build 25.181-b13, mixed mode)

JDBC Driver 6.0 for Windows is copied to: C:\Dev\JDBC

liquibase 3.5.5 copied to: C:\Dev\liquibase

My liquibase.properties file is:

classpath="C:\\Dev\\JDBC\\sqljdbc42.jar"
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
url="jdbc:SQLEXPRESS@localhost:1433:DBName01;integratedSecurity=true;"
referenceUrl="jdbc:SQLEXPRESS@localhost:1433:DBName02;integratedSecurity=true;"

I run liquibase diff on the command line, but get this error:

C:\Dev\liquibase>liquibase diff Unexpected error running Liquibase: C:\Dev\liquibase\"C:\Dev\JDBC\sqljdbc42.jar" does not exist

SEVERE 9/19/18 7:55 PM: liquibase: C:\Dev\liquibase\"C:\Dev\JDBC\sqljdbc42.jar" does not exist liquibase.exception.CommandLineParsingException: C:\Dev\liquibase\"C:\Dev\JDBC\sqljdbc42.jar" does not exist at liquibase.integration.commandline.Main.configureClassLoader(Main.java:828) at liquibase.integration.commandline.Main.run(Main.java:187) at liquibase.integration.commandline.Main.main(Main.java:103)

For more information, use the --logLevel flag

I have copied sqljdbc42.jar to C:\Dev\liquibase\lib, and also to C:\Dev\JDBC and included that in my CLASSPATH. How should I specify the path to this file so liquibase can find it?

Thank you!

2
how did you build your classpath ? can you give us a sample ? - Eric
Don't use backslashes. Use normal slashes like so: classpath=C:/Dev/JDBC/sqljdbc42.jar - Jens
I would also suggest removing the quotes - I think the liquibase.bat file is mangling the path. The path mentioned in the stacktrace looks awful: C:\Dev\liquibase\"C:\Dev\JDBC\sqljdbc42.jar" does not exist - SteveDonie

2 Answers

0
votes

I have a class path defined in properties file as

driver: org.postgresql.Driver
url: jdbc:postgresql://myhost-dbcluster.cluster-c888884ay77jcesov.us-east-1.rds.amazonaws.com:5432/mydb
classpath: C:/Users/Documents/liquibase/lib/postgresql-42.2.16.jar
username: appuser
password: appreal001
0
votes

place the postgresql-42.2.16.jar at liquibase folder location it will work

driver: org.postgresql.Driver url: jdbc:postgresql://myhost-dbcluster.cluster-c888884ay77jcesov.us-east-1.rds.amazonaws.com:5432/mydb classpath: postgresql-42.2.16.jar username: appuser password: appreal001