RC1 -> RC2 upgrade problem

After I upgraded from RC1 -> RC2 I encounter the following problem:

    Exception in thread "main" java.lang.NoSuchMethodError: liquibase.change.core.LoadDataChange.( Ljava/lang/String;Ljava/lang/String;)V        at liquibase.change.core.LoadUpdateDataChange.(LoadUpdateDataChange.java:26)        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java: 39)        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm pl.java:27)        at java.lang.reflect.Constructor.newInstance(Constructor.java:501)        at java.lang.Class.newInstance0(Class.java:350)        at java.lang.Class.newInstance(Class.java:303)        at liquibase.change.ChangeFactory.register(ChangeFactory.java:55)        at liquibase.change.ChangeFactory.(ChangeFactory.java:29)        at liquibase.change.ChangeFactory.getInstance(ChangeFactory.java:43)        at liquibase.parser.core.xml.XMLChangeLogSAXHandler.startElement(XMLChangeLogSAXHandler.java :234)        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXPars er.java:533)        at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValid ator.java:708)        at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDo cumentScannerImpl.java:330)        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDo cumentFragmentScannerImpl.java:368)        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.ja va:834)        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.ja va:764)        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java :1242)        at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXParser.java:80)        at liquibase.Liquibase.update(Liquibase.java:96)

That’s the code I am using:

         String path = ... + "/database.xml";      Liquibase liquibase = new Liquibase(path, new ClassLoaderResourceAccessor()                                        , DatabaseFactory.getInstance().findCorrectDatabaseImplementation(connection));      liquibase.update(null);

database.xml:

    <?xml version="1.0" encoding="UTF-8"?>

    <databaseChangeLog
    xmlns=“http://www.liquibase.org/xml/ns/dbchangelog”
    xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
    xsi:schemaLocation=“http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd”>

       
           
               Initial functions and procedures. Requires MySQL version 5.0+.
           
           
    DROP FUNCTION IF EXISTS bitand;
           
       
       

The same code was working fine with RC1? What do I do wrong?

It is an odd error, it’s like you have an old defintion of LoadDataChange in your classpath. Do you have any other versions of liquibase installed?  Do you get the same error from the latest build? http://liquibase.org/ci/latest ?

Nathan

Great catch! I had the rc1 indeed in the classpath. I auto-generate the classpath from the temporary build directory. rc1 was still there, so both rc1 and rc2 were referenced in the application which caused the error! Deleting rc1.JAR fixed the problem.

Thanks for the quick reply!  :slight_smile: