db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurent ROCHE <laurent_ro...@yahoo.com>
Subject Re : Still one problem when managing schema ... others fixed !
Date Thu, 15 Nov 2007 16:43:19 GMT

----- Message d'origine ----
De : Thomas Dudziak <tomdzk@gmail.com>
À : ddlutils-user@db.apache.org
Envoyé le : Jeudi, 15 Novembre 2007, 17h16mn 35s
Objet : Re: Still one problem when managing schema ... others fixed !

Hi

On Nov 14, 2007 10:25 AM, Laurent ROCHE <laurent_roche@yahoo.com>
 wrote:

> I have made a few fixes to be able to export/import data using
 schemas (on
> PostgreSQL), see files included at the end of the post.
> Most of them are quite ugly fixes but that works for me  ... and
 still, they
> should not interfere with other people usage.
>
> I still have one problem though, when running the following code:
>       ...
>         Platform  platform =
> PlatformFactory.createNewPlatformInstance(dataSource);
>         final DatabaseDataIO dataIO = new DatabaseDataIO();
>         dataIO.setDetermineSchema(true);
>         dataIO.setSchemaPattern(XFR_OUT_SCHEMA);
>         try {
>             FileOutputStream xmlFile = new FileOutputStream(xmlFPN);
>             DatabaseIO reader = new DatabaseIO();
>             Database model = reader.read(getModelFPN(),
 XFR_OUT_SCHEMA);
>             dataIO.writeDataToXML(platform, model, xmlFile,
> XML_FILE_ENCODING);
>             xmlFile.close();
>         } catch (IOException e) {
>             e.printStackTrace();
>             log.error("Error: Could not create " + xmlFPN);
>         }
>      ...
>
> I get the following errors:
>  ERROR [http-80-Processor24] Digester.error(1538) | Parse Error
 at
> line 2 column 32: Document root element "database", must match
 DOCTYPE root
> "null".
> org.xml.sax.SAXParseException: Document root element "database", must
 match
> DOCTYPE root "null".
>     at
>
 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
>     at
>
 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
> ...
>  ERROR [http-80-Processor24] Digester.error(1538) | Parse Error
 at
> line 2 column 32: Document is invalid: no grammar found.
> org.xml.sax.SAXParseException: Document is invalid: no grammar found.
>     at
>
 com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
> ...
> The file is created OK though ! ? ! ?
> What should I do, to get rid of this error messages ?
> I understand they come from the parser going through the XML ... but
 why
> don't I get these when using the Ant tasks ?
> I must do something wrong somewhere !
> Let me know.

There seems to be a problem with the XML file that you're trying to
read (the XML parser is complaining about it).



Yes, I understand that but this is the schema/model file created by the Ant Tasks, and it's
readable without errors by the Ant Tasks.

Here are the first three lines of the model file:
<?xml version='1.0' encoding='UTF-8'?>
<database name="fims_dev_ship">
  <table name="app_languages_del">

The second line is where the parser complains, talking about a DOCTYPE which is not defined.
Do I need to define something else ?


Cheers,
L.






      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message