You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "De Swert Pierre (GFDI)" <P....@gfdi.be> on 2004/01/07 09:47:44 UTC
RE: ojbdoclet task in ant build.xml
> -----Original Message-----
> From: Thomas Dudziak [mailto:tomdz@first.gmd.de]
> Sent: Wednesday, 31 December, 2003 11:12 AM
> To: OJB Users List
> Subject: Re: ojbdoclet task in ant build.xml
>
> >
> > 1.How to avoid editing the project-schema generated via ojb doclets?
> > I have to replace
"http://jakarta.apache.org/turbine/dtd/database.dtd
> > <http://jakarta.apache.org/turbine/dtd/database.dtd> " with
> > "src/schema/database.dtd", otherwise ...
> >
> > [torque-sql] Using contextProperties file:
> > E:\Workspaces\pds\myproject\build.properties
> > [torque-sql] Using classpath
> > [torque-sql] Generating to file
> > E:\Workspaces\pds\myproject\src\sql\report.myproject.sql.generation
> > [torque-sql] Parsing file: 'myproject-schema.xml'
> > [torque-sql] (transform.DTDResolver 140 ) Resolver:
> > used http://jakarta.apache.org/turbine/dtd/database.dtd
> > [torque-sql] (transform.DTDResolver 160 ) Couldn't
read
> > DTD specified in XML schema:
> > [torque-sql] java.net.UnknownHostException: jakarta.apache.org
>
> This is a known problem with some XML parsers. There is an (for
whatever reason yet undocumented)
> attribute of the torque sub task called 'dtdUrl' that allows to
specify the url of the dtd
> in the build file.
I am trying to fix this in my ant builds, but...
1. Which version(s) of the XML Parser is suitable for torque? I have got
the same error with Xerces 2.6.0 (the latest version).
2. I am using torque, version 3.0.2 and apparently the 'dtdUrl'
attribute is not known...
If I edit the build-torque.xml as follows...
<torque-sql
contextProperties="${build.properties}"
controlTemplate="${SQLControlTemplate}"
outputDirectory="${torque.home}/${outputDirectory}/sql"
useClasspath="true"
basePathToDbProps="sql/base/"
sqldbmap="${torque.home}/${outputDirectory}/sql/sqldb.map"
outputFile="report.${project}.sql.generation"
targetDatabase="${database}"
dtdUrl="src/schema/database.dtd"
idTableXMLFile="${idTableXMLFile}">
<fileset dir="${torque.home}/${schemaDirectory}">
<include name="*-schema.xml"/>
</fileset>
</torque-sql>
the torque task complains that it does not support the "dtdurl"
attribute.
prepare-db:
project-sql-classpath:
[echo] +------------------------------------------+
[echo] | |
[echo] | Generating SQL for OJB Testsuite! |
[echo] | enJoy! |
[echo] | |
[echo] +------------------------------------------+
[torque-sql] Using contextProperties file:
E:\Workspaces\pds\myproject\build.properties
BUILD FAILED
E:/Workspaces/pds/myproject/build-torque.xml:454: The
<torque-sql> task doesn't support
the "dtdurl" attribute.
Do I need a more recent version of torque to use the "dtdurl"
attribute?
Best regards,
Pierre
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
RE: ojbdoclet task in ant build.xml
Posted by Thomas Dudziak <to...@first.gmd.de>.
> 1. Which version(s) of the XML Parser is suitable for torque? I have got
> the same error with Xerces 2.6.0 (the latest version).
The one that comes with OJB (in the lib folder) works without problems
when you use the dtdUrl attribute (see below).
> 2. I am using torque, version 3.0.2 and apparently the 'dtdUrl'
> attribute is not known...
> If I edit the build-torque.xml as follows...
>
> <torque-sql
> contextProperties="${build.properties}"
> controlTemplate="${SQLControlTemplate}"
> outputDirectory="${torque.home}/${outputDirectory}/sql"
> useClasspath="true"
> basePathToDbProps="sql/base/"
> sqldbmap="${torque.home}/${outputDirectory}/sql/sqldb.map"
> outputFile="report.${project}.sql.generation"
> targetDatabase="${database}"
> dtdUrl="src/schema/database.dtd"
> idTableXMLFile="${idTableXMLFile}">
> <fileset dir="${torque.home}/${schemaDirectory}">
> <include name="*-schema.xml"/>
> </fileset>
> </torque-sql>
>
> the torque task complains that it does not support the "dtdurl"
> attribute.
Ahem, no, the dtdUrl is not a property of the torque-sql task but of the
torque subtask of the XDoclet OJB module (the torque-sql task is only the
place where the error occurs). You use it like this:
<taskdef name="ojbdoclet"
classname="xdoclet.modules.ojb.OjbDocletTask"
classpathref="project.class.path"/>
<ojbdoclet destdir="${build.dir}">
<fileset dir="${src.dir}"/>
<ojbrepository destinationFile="${ojb.repository.file}"/>
<torqueschema databaseName="${project}"
dtdUrl="http://db.apache.org/torque/dtd/database_3_0_1.dtd"
destinationFile="${ojb.schema.file}"/>
</ojbdoclet>
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org