首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Liquibase更新失败

Liquibase更新失败
EN

Stack Overflow用户
提问于 2012-08-31 11:58:06
回答 2查看 6.1K关注 0票数 4

我在liquibase上使用以下快速入门

我的xml代码:

代码语言:javascript
复制
<?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">

    <changeSet id="1" author="bob">
        <createTable tableName="department">
            <column name="id" type="int">
                <constraints primaryKey="true" nullable="false"/>
            </column>
            <column name="name" type="varchar(50)">
                <constraints nullable="false"/>
            </column>
            <column name="active" type="boolean" defaultValueBoolean="true"/>
        </createTable>
    </changeSet>

</databaseChangeLog>

当我通过命令行使用"update“命令运行Liquibase时,.Liquibase告诉我这一点

代码语言:javascript
复制
INFO 8/31/12 9:17 AM:liquibase: Successfully released change log lock
Liquibase Update Failed: Content is not allowed in prolog.
SEVERE 8/31/12 9:17 AM:liquibase: Content is not allowed in prolog.
liquibase.exception.ChangeLogParseException: Error parsing line 1 column 1 of dat
abase.xml: Content is not allowed in prolog.
        at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXP
arser.java:106)
        at liquibase.Liquibase.update(Liquibase.java:107)

我的更新命令是

代码语言:javascript
复制
liquibase --driver=com.mysql.jdbc.Driver  --classpath=mysql-connector-java-5.1.6.jar   --changeLogFile=database.xml --url="jdbc:mysql://localhost:3306/sample" --username=root --password=password  update

我该怎么做呢?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-08-31 12:20:21

这可能是因为XML文件的开头有几个隐藏字符(如BOM、google XML BOM以获取更多信息)。

This link演示了如何删除物料清单。

如果你使用的是Windows,XVI32 (一个免费的十六进制编辑器)将为你工作。

票数 2
EN

Stack Overflow用户

发布于 2016-08-17 20:10:41

请参阅Liquibase JIRA issue

此问题与给定链接的附件示例中具有模式定义的模式definitions...try相关

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12208706

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档