I'm trying to run liquibase changeLog using Spring, as described in docs, but i get the following error:
Could not instantiate bean class [liquibase.integration.spring.SpringLiquibase]:Constructor threw exception; nested exception is java.lang.ExceptionInInitializerError*
This is my applicationContext.xml:
<bean destroy-method="close"> <property name="driverClass" value="com.mysql.jdbc.Driver" /> <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/qacube" /> <property name="user" value="root" /> <property name="password" value="" /> <!-- c3po --> <property name="initialPoolSize" value="5" /> <property name="autoCommitOnClose" value="false" /> <property name="idleConnectionTestPeriod" value="10" /> <property name="testConnectionOnCheckin" value="true" /> <property name="preferredTestQuery" value="SELECT 1" /> <property name="maxPoolSize" value="100" /> <property name="minPoolSize" value="5" /> </bean> <bean depends-on="dataSourceLb"> <property name="dataSource" ref="dataSourceLb" /> <property name="changeLog" value="classpath:mastertest.xml" /> </bean> and i added this dependency to pom.xml:
<dependency> <groupId>org.liquibase</groupId> <artifactId>liquibase-core</artifactId> <version>3.2.0</version> </dependency> mastertest.xml is valid, it runs with maven, but i want to make it run with Spring bean.
What is the problem with this configuration?
51 Answer
I changed changeLog property's value to "classpath:liquibase/mastertest.xml" because mastertest.xml is in the ProjectHome/src/main/resources/liquibase folder, and it is working now.