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 Avril Kotzen <ak...@concordetravel.co.za> on 2004/02/26 18:07:30 UTC
Help needed with xdoclet- Not generating class-descriptor
Hi
I want to generate class-descriptors using xdoclet. I am using the OJB
xdoclet jar files from the contrib directory of OJB 1.0.rc5.
I have put OJB.s Article.java, AbstractArticle.java and Interface
Article .java in the ojbdoclet fileset directory. When I try to
generate repository mappings I get a file with 2 lines of comments
only. No class-descriptors are generated. These files are being picked
up as I get info messages about defaulting the package names. I have
also tried with my own java files with the same result.
Here is my buildfile.
<?xml version="1.0" encoding="UTF-8"?>
<!-- OJB ant build script for xdoclet use -->
<project name="OJB XDoclet" default="repository-files" >
<path id="ojb-classpath">
<fileset dir="lib/xdoclet">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="repository-files">
<taskdef name="ojbdoclet"
classname="xdoclet.modules.ojb.OjbDocletTask">
<classpath refid="ojb-classpath"/>
</taskdef>
<ojbdoclet
destdir="./out">
<fileset dir="./src"/>
<ojbrepository destinationFile="repository_user.xml"/>
</ojbdoclet>
</target>
</project>
I have not downloaded the xdoclet code from the CVS. (firewall
restrictions). Could this be my problem?
Other than -buildfile are there other arguments that I should be passing
to ant.
Any advice on what I am doing wrong would be appreciated.
Thanks for your help
Avril
Re: Help needed with xdoclet- Not generating class-descriptor
Posted by Thomas Dudziak <to...@first.gmd.de>.
On Thu, 26 Feb 2004, Avril Kotzen wrote:
> I have put OJB.s Article.java, AbstractArticle.java and Interface
> Article .java in the ojbdoclet fileset directory. When I try to
> generate repository mappings I get a file with 2 lines of comments
> only. No class-descriptors are generated. These files are being picked
> up as I get info messages about defaulting the package names. I have
> also tried with my own java files with the same result.
General advise:
If you have problems with some ant task, try to run ant with the -v
option, this will generate more output. If that doesn't help, you can try
the -debug option (instead of -v), but this will generate quite a lot of
messages (logging mode debug).
I'm not entirely sure what you mean by 'I have put OJB.s Article.java,
AbstractArticle.java and InterfaceArticle.java in the ojbdoclet fileset
directory'. The general idea of XDoclet is that you put special javadoc
tags into your source (e.g. @ojb.class, @ojb.field etc.), then let the ant
task of the specific XDoclet module (ojbdoclet in your case) process these
sources, which will lead to some generated files
(here: repository_user.xml and, if used, project-schema.xml).
So, if you use some classes that came with OJB, it is unlikely that they
contain these tags.
Also, be sure that the directory structure matches the java
packages. E.g., if you specify 'fileset dir="./src"' and you want to
process some class mypckg.MyClass, then in the directory ./src there must
be a subdirectory mypckg which contains the file MyClass.java. In general
you specify the same folder(s) for the ojb xdoclet task that you use for
the javac ant task.
> Here is my buildfile.
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- OJB ant build script for xdoclet use -->
> <project name="OJB XDoclet" default="repository-files" >
> <path id="ojb-classpath">
> <fileset dir="lib/xdoclet">
> <include name="**/*.jar"/>
> </fileset>
> </path>
> <target name="repository-files">
> <taskdef name="ojbdoclet"
> classname="xdoclet.modules.ojb.OjbDocletTask">
> <classpath refid="ojb-classpath"/>
> </taskdef>
> <ojbdoclet
> destdir="./out">
> <fileset dir="./src"/>
> <ojbrepository destinationFile="repository_user.xml"/>
>
> </ojbdoclet>
> </target>
> </project>
This seems to be ok.
> I have not downloaded the xdoclet code from the CVS. (firewall
> restrictions). Could this be my problem?
This should not be necessary. The three jars of the OJB xdoclet module
(XDoclet, XJavaDoc, ojb module) correspond to the current source.
> Other than -buildfile are there other arguments that I should be passing
> to ant.
All supported options are described in the documentation (in CVS, xdocs
subdirectory; you have to build OJB's documentation with 'ant htmldocs' to
generate html).
Tom
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org