db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Korosy <g.kor...@ns98.com.au>
Subject Re: DatabaseIO does not read
Date Tue, 14 Feb 2006 00:52:51 GMT
>
> On 2/13/06, George Korosy <g.korosy@ns98.com.au> wrote:
> > DatabaseIO.read() when invoked either with a java.io.File or a
> > java.io.FileReader argument throws DdlUtilsException with
> > java.net.MalformedURLException causes, nested to an infinite depth.
>
> Please post more info, e.g. the code snippet you use, what you feed
> into the File/FileReader, the stacktrace.
>
> Tom
>   


Tom, this is code:

private static Database createDb(File schema) {
    Database result = null;
   
    try {
        result = new DatabaseIO().read(schema);
    } catch (DdlUtilsException e) {
        e.printStackTrace();

        try {
            final BufferedReader reader = new BufferedReader(new 
FileReader(schema));
            System.out.println();
            System.out.println("=== ... while reading input: 
===================================");
            for ( String line = reader.readLine(); line != null; line = 
reader.readLine() ) {
                System.out.println(line);
            }
            
System.out.println("================================================================");
        } catch (FileNotFoundException e1) {
            e1.printStackTrace();
        } catch (IOException e1) {
            e1.printStackTrace();
        }
    }

    return result;
}

And this is output:

org.apache.ddlutils.DdlUtilsException: java.net.MalformedURLException
    at org.apache.ddlutils.io.DatabaseIO.read(DatabaseIO.java:172)
    at 
au.com.ns98.dandf.persistence.builder.SchemaBuilder.createDb(SchemaBuilder.java:183)
    at 
au.com.ns98.dandf.persistence.builder.SchemaBuilder.main(SchemaBuilder.java:104)
Caused by: java.net.MalformedURLException
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at java.net.URL.<init>(Unknown Source)
    at 
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown 
Source)
    at 
com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(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 org.apache.commons.digester.Digester.parse(Digester.java:1647)
    at 
org.apache.commons.betwixt.XMLIntrospector.loadMultiMapping(XMLIntrospector.java:657)
    at 
org.apache.commons.betwixt.XMLIntrospector.register(XMLIntrospector.java:627)
    at 
org.apache.commons.betwixt.io.BeanReader.registerMultiMapping(BeanReader.java:215)
    at org.apache.ddlutils.io.DatabaseIO.getReader(DatabaseIO.java:109)
    at org.apache.ddlutils.io.DatabaseIO.read(DatabaseIO.java:168)
    ... 2 more

=== ... while reading input: ===================================
<?xml version="1.0" encoding="ISO-8859-1"?>

<database name="bookstore">
  <table name="author">
    <column name="author_id" type="INTEGER" primaryKey="true" 
required="true"/>
    <column name="name" type="VARCHAR" size="50" required="true"/>
    <column name="organisation" type="VARCHAR" size="50" required="false"/>
  </table>

  <table name="book">
    <column name="book_id" type="INTEGER" required="true" 
primaryKey="true" autoIncrement="true"/>
    <column name="isbn" type="VARCHAR" size="15" required="true"/>
    <column name="author_id" type="INTEGER" required="true"/>
    <column name="title" type="VARCHAR" size="255" defaultValue="N/A" 
required="true"/>
       
    <foreign-key foreignTable="author">
    <reference local="author_id" foreign="author_id"/>
    </foreign-key> 

    <index name="book_isbn">
    <index-column name="isbn"/>
    </index>
  </table>

  <table name="coltype">
    <column name="COL_INTEGER" primaryKey="false" required="false" 
type="INTEGER"/>
    <column name="COL_FLOAT" primaryKey="false" required="false" 
type="FLOAT"/>
    <column name="COL_DECIMAL" primaryKey="false" required="false" 
scale="3" size="15" type="DECIMAL"/>
    <column name="COL_DEC_NOSCALE" primaryKey="false" required="false" 
size="15" type="DECIMAL"/>
    <column name="COL_CHAR" primaryKey="false" required="false" 
size="15" type="CHAR"/>
    <column name="COL_VARCHAR" primaryKey="false" required="false" 
size="15" type="VARCHAR"/>
    <column name="COL_DATE" primaryKey="false" required="false" 
type="DATE"/>
    <column name="COL_TIME" primaryKey="false" required="false" 
type="TIME"/>
    <column name="COL_TIMESTAMP" primaryKey="false" required="false" 
type="TIMESTAMP"/>
  </table>

</database>
================================================================


I hope all this does make sense to you, inspite of the last two traces 
at the bottom being swallowed & thank again, George

Mime
View raw message