Hi all,
I am expierencing a problem with 2.0-RC5 (liquibase-2.0-rc5-bin) that is similar to the one posted by roelof (http://liquibase.org/forum/index.php?topic=93.msg350): A preConditions tag causes LiquiBase to throw a parser error. Without the preConditions tag the script works fine. Is there anyone who can give a hint?
-Thanks in advance!!
Here is the changelog:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><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”
<changeSet author="frank" id="26000000">
<comment>myComment</comment>
<preConditions onFail="MARK_RAN">
<not>
<tableExists schemaName="${liquibase.schema}" tableName="myTable"/>
</not>
</preConditions>
<createTable schemaName="${liquibase.schema}" tableName="myTable">
<column name="myCol1" type="java.sql.Types.VARCHAR(50)"/>
[…]
Here is LiquiBase’s output:
INFO 08.11.10 15:43:liquibase: Can not use class liquibase.executor.LoggingExecutor as a Liquibase service because it does not have a default constructor
08.11.2010 15:43:16 liquibase.logging.jvm.JavaUtilLogger info
INFO: Successfully acquired change log lock
08.11.2010 15:43:16 liquibase.logging.jvm.JavaUtilLogger severe
SCHWERWIEGEND: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘preConditions’. One of ‘{“http://www.liquibase.org/xml/ns/dbchangelog”:comment, “http://www.liquibase.org/xml/ns/dbchangelog”:createTable, “http://www.liquibase.org/xml/ns/dbchangelog”:dropTable, “http://www.liquibase.org/xml/ns/dbchangelog”:createView, “http://www.liquibase.org/xml/ns/dbchangelog”:renameView, “http://www.liquibase.org/xml/ns/dbchangelog”:dropView, “http://www.liquibase.org/xml/ns/dbchangelog”:insert, “http://www.liquibase.org/xml/ns/dbchangelog”:addColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:sql, “http://www.liquibase.org/xml/ns/dbchangelog”:createProcedure, “http://www.liquibase.org/xml/ns/dbchangelog”:sqlFile, “http://www.liquibase.org/xml/ns/dbchangelog”:renameTable, “http://www.liquibase.org/xml/ns/dbchangelog”:renameColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:dropColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:mergeColumns, “http://www.liquibase.org/x
ml/ns/dbchangelog”:modifyDataType, “http://www.liquibase.org/xml/ns/dbchangelog”:createSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:alterSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:dropSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:createIndex, “http://www.liquibase.org/xml/ns/dbchangelog”:dropIndex, “http://www.liquibase.org/xml/ns/dbchangelog”:addNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:addForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropAllForeignKeyConstraints, “http://www.liquibase.org/xml/ns/dbchangelog”:addPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog”:dropPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog”:addLookupTable, “http://www.liquibase.org/xml/ns/dbchangelog”:addAutoIncrement, “http://www.liquibase.org/xml/ns/dbchangelog”:addDefaultValue
, “http://www.liquibase.org/xml/ns/dbchangelog”:dropDefaultValue, “http://www.liquibase.org/xml/ns/dbchangelog”:addUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:customChange, “http://www.liquibase.org/xml/ns/dbchangelog”:update, “http://www.liquibase.org/xml/ns/dbchangelog”:delete, “http://www.liquibase.org/xml/ns/dbchangelog”:loadData, “http://www.liquibase.org/xml/ns/dbchangelog”:loadUpdateData, “http://www.liquibase.org/xml/ns/dbchangelog”:executeCommand, “http://www.liquibase.org/xml/ns/dbchangelog”:stop, “http://www.liquibase.org/xml/ns/dbchangelog”:rollback, WC[##other:“http://www.liquibase.org/xml/ns/dbchangelog”], “http://www.liquibase.org/xml/ns/dbchangelog”:modifySql}’ is expected.
08.11.2010 15:43:16 liquibase.logging.jvm.JavaUtilLogger info
INFO: Successfully released change log lock
Liquibase Update Failed: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘preConditions’. One of ‘{“http://www.liquibase.org/xml/ns/dbchangelog”:comment, “http://www.liquibase.org/xml/ns/dbchangelog”:createTable, “http://www.liquibase.org/xml/ns/dbchangelog”:dropTable, “http://www.liquibase.org/xml/ns/dbchangelog”:createView, “http://www.liquibase.org/xml/ns/dbchangelog”:renameView, “http://www.liquibase.org/xml/ns/dbchangelog”:dropView, “http://www.liquibase.org/xml/ns/dbchangelog”:insert, “http://www.liquibase.org/xml/ns/dbchangelog”:addColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:sql, “http://www.liquibase.org/xml/ns/dbchangelog”:createProcedure, “http://www.liquibase.org/xml/ns/dbchangelog”:sqlFile, “http://www.liquibase.org/xml/ns/dbchangelog”:renameTable, “http://www.liquibase.org/xml/ns/dbchangelog”:renameColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:dropColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:mergeColumns, “http://www.liqui
base.org/xml/ns/dbchangelog”:modifyDataType, “http://www.liquibase.org/xml/ns/dbchangelog”:createSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:alterSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:dropSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:createIndex, “http://www.liquibase.org/xml/ns/dbchangelog”:dropIndex, “http://www.liquibase.org/xml/ns/dbchangelog”:addNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:addForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropAllForeignKeyConstraints, “http://www.liquibase.org/xml/ns/dbchangelog”:addPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog”:dropPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog”:addLookupTable, “http://www.liquibase.org/xml/ns/dbchangelog”:addAutoIncrement, “http://www.liquibase.org/xml/ns/dbchangelog”:addDe
faultValue, “http://www.liquibase.org/xml/ns/dbchangelog”:dropDefaultValue, “http://www.liquibase.org/xml/ns/dbchangelog”:addUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:customChange, “http://www.liquibase.org/xml/ns/dbchangelog”:update, “http://www.liquibase.org/xml/ns/dbchangelog”:delete, “http://www.liquibase.org/xml/ns/dbchangelog”:loadData, “http://www.liquibase.org/xml/ns/dbchangelog”:loadUpdateData, “http://www.liquibase.org/xml/ns/dbchangelog”:executeCommand, “http://www.liquibase.org/xml/ns/dbchangelog”:stop, “http://www.liquibase.org/xml/ns/dbchangelog”:rollback, WC[##other:“http://www.liquibase.org/xml/ns/dbchangelog”], “http://www.liquibase.org/xml/ns/dbchangelog”:modifySql}’ is expected… For more information, use the --logLevel flag)
08.11.2010 15:43:16 liquibase.logging.jvm.JavaUtilLogger info
INFO: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘preConditions’. One of ‘{“http://www.liquibase.org/xml/ns/dbchangelog”:comment, “http://www.liquibase.org/xml/ns/dbchangelog”:createTable, “http://www.liquibase.org/xml/ns/dbchangelog”:dropTable, “http://www.liquibase.org/xml/ns/dbchangelog”:createView, “http://www.liquibase.org/xml/ns/dbchangelog”:renameView, “http://www.liquibase.org/xml/ns/dbchangelog”:dropView, “http://www.liquibase.org/xml/ns/dbchangelog”:insert, “http://www.liquibase.org/xml/ns/dbchangelog”:addColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:sql, “http://www.liquibase.org/xml/ns/dbchangelog”:createProcedure, “http://www.liquibase.org/xml/ns/dbchangelog”:sqlFile, “http://www.liquibase.org/xml/ns/dbchangelog”:renameTable, “http://www.liquibase.org/xml/ns/dbchangelog”:renameColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:dropColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:mergeColumns, “http://www.liquibase.org/xml/ns/dbc
hangelog”:modifyDataType, “http://www.liquibase.org/xml/ns/dbchangelog”:createSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:alterSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:dropSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:createIndex, “http://www.liquibase.org/xml/ns/dbchangelog”:dropIndex, “http://www.liquibase.org/xml/ns/dbchangelog”:addNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:addForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropAllForeignKeyConstraints, “http://www.liquibase.org/xml/ns/dbchangelog”:addPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog”:dropPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog”:addLookupTable, “http://www.liquibase.org/xml/ns/dbchangelog”:addAutoIncrement, “http://www.liquibase.org/xml/ns/dbchangelog”:addDefaultValue, “http:/
/www.liquibase.org/xml/ns/dbchangelog”:dropDefaultValue, “http://www.liquibase.org/xml/ns/dbchangelog”:addUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:customChange, “http://www.liquibase.org/xml/ns/dbchangelog”:update, “http://www.liquibase.org/xml/ns/dbchangelog”:delete, “http://www.liquibase.org/xml/ns/dbchangelog”:loadData, “http://www.liquibase.org/xml/ns/dbchangelog”:loadUpdateData, “http://www.liquibase.org/xml/ns/dbchangelog”:executeCommand, “http://www.liquibase.org/xml/ns/dbchangelog”:stop, “http://www.liquibase.org/xml/ns/dbchangelog”:rollback, WC[##other:“http://www.liquibase.org/xml/ns/dbchangelog”], “http://www.liquibase.org/xml/ns/dbchangelog”:modifySql}’ is expected.
liquibase.exception.ChangeLogParseException: Error parsing line 10 column 36 of 26000000_all_Meta-Structure-Init-Create.xml: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘preConditions’. One of ‘{“http://www.liquibase.org/xml/ns/dbchangelog”:comment, “http://www.liquibase.org/xml/ns/dbchangelog”:createTable, “http://www.liquibase.org/xml/ns/dbchangelog”:dropTable, “http://www.liquibase.org/xml/ns/dbchangelog”:createView, “http://www.liquibase.org/xml/ns/dbchangelog”:renameView, “http://www.liquibase.org/xml/ns/dbchangelog”:dropView, “http://www.liquibase.org/xml/ns/dbchangelog”:insert, “http://www.liquibase.org/xml/ns/dbchangelog”:addColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:sql, “http://www.liquibase.org/xml/ns/dbchangelog”:createProcedure, “http://www.liquibase.org/xml/ns/dbchangelog”:sqlFile, “http://www.liquibase.org/xml/ns/dbchangelog”:renameTable, “http://www.liquibase.org/xml/ns/dbchangelog”:renameColumn, “http://www.liquibase.org/xml/ns/db
changelog”:dropColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:mergeColumns, “http://www.liquibase.org/xml/ns/dbchangelog”:modifyDataType, “http://www.liquibase.org/xml/ns/dbchangelog”:createSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:alterSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:dropSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:createIndex, “http://www.liquibase.org/xml/ns/dbchangelog”:dropIndex, “http://www.liquibase.org/xml/ns/dbchangelog”:addNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:addForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropAllForeignKeyConstraints, “http://www.liquibase.org/xml/ns/dbchangelog”:addPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog”:dropPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog”:addLookupTable, “http://www.liq
uibase.org/xml/ns/dbchangelog”:addAutoIncrement, “http://www.liquibase.org/xml/ns/dbchangelog”:addDefaultValue, “http://www.liquibase.org/xml/ns/dbchangelog”:dropDefaultValue, “http://www.liquibase.org/xml/ns/dbchangelog”:addUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:customChange, “http://www.liquibase.org/xml/ns/dbchangelog”:update, “http://www.liquibase.org/xml/ns/dbchangelog”:delete, “http://www.liquibase.org/xml/ns/dbchangelog”:loadData, “http://www.liquibase.org/xml/ns/dbchangelog”:loadUpdateData, “http://www.liquibase.org/xml/ns/dbchangelog”:executeCommand, “http://www.liquibase.org/xml/ns/dbchangelog”:stop, “http://www.liquibase.org/xml/ns/dbchangelog”:rollback, WC[##other:“http://www.liquibase.org/xml/ns/dbchangelog”], “http://www.liquibase.org/xml/ns/dbchangelog”:modifySql}’ is expected.
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXParser.java:93)
at liquibase.Liquibase.update(Liquibase.java:102)
at liquibase.integration.commandline.Main.doMigration(Main.java:672)
at liquibase.integration.commandline.Main.main(Main.java:105)
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘preConditions’. One of ‘{“http://www.liquibase.org/xml/ns/dbchangelog”:comment, “http://www.liquibase.org/xml/ns/dbchangelog”:createTable, “http://www.liquibase.org/xml/ns/dbchangelog”:dropTable, “http://www.liquibase.org/xml/ns/dbchangelog”:createView, “http://www.liquibase.org/xml/ns/dbchangelog”:renameView, “http://www.liquibase.org/xml/ns/dbchangelog”:dropView, “http://www.liquibase.org/xml/ns/dbchangelog”:insert, “http://www.liquibase.org/xml/ns/dbchangelog”:addColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:sql, “http://www.liquibase.org/xml/ns/dbchangelog”:createProcedure, “http://www.liquibase.org/xml/ns/dbchangelog”:sqlFile, “http://www.liquibase.org/xml/ns/dbchangelog”:renameTable, “http://www.liquibase.org/xml/ns/dbchangelog”:renameColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:dropColumn, “http://www.liquibase.org/xml/ns/dbchangelog”:mergeColumns,
“http://www.liquibase.org/xml/ns/dbchangelog”:modifyDataType, “http://www.liquibase.org/xml/ns/dbchangelog”:createSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:alterSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:dropSequence, “http://www.liquibase.org/xml/ns/dbchangelog”:createIndex, “http://www.liquibase.org/xml/ns/dbchangelog”:dropIndex, “http://www.liquibase.org/xml/ns/dbchangelog”:addNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:addForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropAllForeignKeyConstraints, “http://www.liquibase.org/xml/ns/dbchangelog”:addPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog”:dropPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog”:addLookupTable, “http://www.liquibase.org/xml/ns/dbchangelog”:addAutoIncrement, “http://www.liquibase.org/xml/ns/d
bchangelog”:addDefaultValue, “http://www.liquibase.org/xml/ns/dbchangelog”:dropDefaultValue, “http://www.liquibase.org/xml/ns/dbchangelog”:addUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:dropUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog”:customChange, “http://www.liquibase.org/xml/ns/dbchangelog”:update, “http://www.liquibase.org/xml/ns/dbchangelog”:delete, “http://www.liquibase.org/xml/ns/dbchangelog”:loadData, “http://www.liquibase.org/xml/ns/dbchangelog”:loadUpdateData, “http://www.liquibase.org/xml/ns/dbchangelog”:executeCommand, “http://www.liquibase.org/xml/ns/dbchangelog”:stop, “http://www.liquibase.org/xml/ns/dbchangelog”:rollback, WC[##other:“http://www.liquibase.org/xml/ns/dbchangelog”], “http://www.liquibase.org/xml/ns/dbchangelog”:modifySql}’ is expected.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXParser.java:85)
… 3 more