db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy Davis <da...@guydavis.ca>
Subject DDL to Database task: no model name?
Date Tue, 07 Feb 2006 15:09:49 GMT
Hello,

Here are some more details on the error I'm getting when trying to 
create tables from a schema XML file.

Here is the schema.xml file I'm trying to load (dumped from Oracle 9i) 
using DatabaseToDdlTask.

<database>
     <table name="DV_AREA">
       <column name="AREA_ID" primaryKey="true" required="true" 
type="VARCHAR" size="20" autoIncrement="false"/>
       <column name="AREA_NAME" primaryKey="false" required="true" 
type="VARCHAR" size="80" autoIncrement="false"/>
       <column name="SECTOR_ID" primaryKey="false" required="true" 
type="VARCHAR" size="20" autoIncrement="false"/>
       <column name="ROW_CREATED_DATE" primaryKey="false" 
required="false" type="TIMESTAMP" size="7" autoIncrement="false"/>
       <column name="ROW_CREATED_BY" primaryKey="false" required="false" 
type="VARCHAR" size="30" autoIncrement="false"/>
       <column name="ROW_UPDATED_DATE" primaryKey="false" 
required="false" type="TIMESTAMP" size="7" autoIncrement="false"/>
       <column name="ROW_UPDATED_BY" primaryKey="false" required="false" 
type="VARCHAR" size="30" autoIncrement="false"/>
       <foreign-key foreignTable="DV_SECTOR" name="DV_AREA_FK">
         <reference local="SECTOR_ID" foreign="SECTOR_ID"/>
       </foreign-key>
       <unique name="DV_AREA_PK">
         <unique-column name="AREA_ID"/>
       </unique>
     </table>
    ... many more table defintions ...
   </database>


Here's the Ant log output...

[ddl_to_db] Feb 7, 2006 8:03:56 AM org.apache.commons.digester.Digester 
error
[ddl_to_db] SEVERE: Parse Error at line 2 column 11: Document root 
element "database", must match DOCTYPE root "null".
[ddl_to_db] org.xml.sax.SAXParseException: Document root element 
"database", must match DOCTYPE root "null".
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(XMLDTDValidator.java:1652)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1931)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:795)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:878)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:1157)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
[ddl_to_db] at 
org.apache.commons.digester.Digester.parse(Digester.java:1631)
[ddl_to_db] at org.apache.ddlutils.io.DatabaseIO.read(DatabaseIO.java:173)
[ddl_to_db] at 
org.apache.ddlutils.task.DdlToDatabaseTask.readSingleSchemaFile(DdlToDatabaseTask.java:219)
[ddl_to_db] at 
org.apache.ddlutils.task.DdlToDatabaseTask.readModel(DdlToDatabaseTask.java:160)
[ddl_to_db] at 
org.apache.ddlutils.task.DatabaseTaskBase.execute(DatabaseTaskBase.java:193)
[ddl_to_db] at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[ddl_to_db] at org.apache.tools.ant.Task.perform(Task.java:364)
[ddl_to_db] at org.apache.tools.ant.Target.execute(Target.java:341)
[ddl_to_db] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[ddl_to_db] at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[ddl_to_db] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[ddl_to_db] at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[ddl_to_db] at 
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[ddl_to_db] at 
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[ddl_to_db] at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[ddl_to_db] at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[ddl_to_db] Feb 7, 2006 8:03:56 AM org.apache.commons.digester.Digester 
error
[ddl_to_db] SEVERE: Parse Error at line 2 column 11: Document is 
invalid: no grammar found.
[ddl_to_db] org.xml.sax.SAXParseException: Document is invalid: no 
grammar found.
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1941)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:795)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:878)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:1157)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
[ddl_to_db] at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
[ddl_to_db] at 
org.apache.commons.digester.Digester.parse(Digester.java:1631)
[ddl_to_db] at org.apache.ddlutils.io.DatabaseIO.read(DatabaseIO.java:173)
[ddl_to_db] at 
org.apache.ddlutils.task.DdlToDatabaseTask.readSingleSchemaFile(DdlToDatabaseTask.java:219)
[ddl_to_db] at 
org.apache.ddlutils.task.DdlToDatabaseTask.readModel(DdlToDatabaseTask.java:160)
[ddl_to_db] at 
org.apache.ddlutils.task.DatabaseTaskBase.execute(DatabaseTaskBase.java:193)
[ddl_to_db] at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
[ddl_to_db] at org.apache.tools.ant.Task.perform(Task.java:364)
[ddl_to_db] at org.apache.tools.ant.Target.execute(Target.java:341)
[ddl_to_db] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[ddl_to_db] at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[ddl_to_db] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
[ddl_to_db] at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[ddl_to_db] at 
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[ddl_to_db] at 
org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[ddl_to_db] at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[ddl_to_db] at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

BUILD FAILED
C:\Development\trunk\build.xml:451: Could not read schema file 
C:\Development\trunk\schema.xml: The database model has no name

Total time: 2 seconds

Thanks in advance for any help you can provide.

Guy


Mime
View raw message