facebook

XDoclet / Hibernate [Closed]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #206849 Reply

    BJ Hellstrom
    Member

    Added hibernate tags to my Class, and added the “Standard Hibernate” XDoclet configuration to my project. When I run XDoclet from the project context menu I get —

    Buildfile: C:\Dev\DCL_Web\xdoclet-build.xml
    N10004:
    [hibernatedoclet] (XDocletMain.start 47 ) Running <hibernate/>
    _generation_:
    BUILD SUCCESSFUL

    But I get no hibernate-mapping XML file. Nada. What am I missing here?

    #206853 Reply

    Greg
    Member

    Could you post your hibernate tags? I tested hibernate tags based off the examples found here.

    http://cvs.sourceforge.net/viewcvs.py/xdoclet/xdoclet/samples/src/java/test/hibernate/

    The correct hibernate files were generated by using the “Standard hibernate” configuration. Give us some more info and we will help you get it working.

    #206854 Reply

    BJ Hellstrom
    Member

    The entire set of tags from my source file –

    /**
    * @hibernate.class table=”request”
    */

    /**
    * @hibernate.id generator-class = “native” name=”id”
    */

    /**
    * @hibernate.property name=”ipaddr”
    */

    /**
    * @hibernate.property name=”jvm”
    */

    /**
    * @hibernate.property name=”password”
    */

    /**
    * @hibernate.property name=”time”
    */

    /**
    * @hibernate.property name=”tmpFileName”
    */

    /**
    * @hibernate.property name=”uploadFileName”
    */

    The xdoclte-build.xml file (generated by Myeclipse) –

    <?xml version=”1.0″ encoding=”UTF-8″?>
    <project default=”_generation_” name=”XDoclet Generator”>
    <path id=”xdoclet.classpath”><pathelement location=”C:/Dev/DCL_Web/webroot/WEB-INF/classes”/>
    <pathelement location=”C:/j2sdk1.4.2_04/jre/lib/rt.jar”/>
    <pathelement location=”C:/j2sdk1.4.2_04/jre/lib/sunrsasign.jar”/>
    <pathelement location=”C:/j2sdk1.4.2_04/jre/lib/jsse.jar”/>
    <pathelement location=”C:/j2sdk1.4.2_04/jre/lib/jce.jar”/>
    <pathelement location=”C:/j2sdk1.4.2_04/jre/lib/charsets.jar”/>
    <pathelement location=”C:/j2sdk1.4.2_04/jre/lib/ext/dnsns.jar”/>
    <pathelement location=”C:/j2sdk1.4.2_04/jre/lib/ext/ldapsec.jar”/>
    <pathelement location=”C:/j2sdk1.4.2_04/jre/lib/ext/localedata.jar”/>
    <pathelement location=”C:/j2sdk1.4.2_04/jre/lib/ext/sunjce_provider.jar”/>
    <pathelement location=”/E:/MyEclipseIde030702/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.7.2/data/libraryset/1.3/activation.jar”/>
    <pathelement location=”/E:/MyEclipseIde030702/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.7.2/data/libraryset/1.3/javax.servlet.jar”/>
    <pathelement location=”/E:/MyEclipseIde030702/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.7.2/data/libraryset/1.3/jboss-j2ee.jar”/>
    <pathelement location=”/E:/MyEclipseIde030702/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.7.2/data/libraryset/1.3/jboss-jaas.jar”/>
    <pathelement location=”/E:/MyEclipseIde030702/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.7.2/data/libraryset/1.3/jsse.jar”/>
    <pathelement location=”/E:/MyEclipseIde030702/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.7.2/data/libraryset/1.3/jts.jar”/>
    <pathelement location=”/E:/MyEclipseIde030702/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_3.7.2/data/libraryset/1.3/mail.jar”/>
    <pathelement location=”C:/Dev/XCS/classes”/>
    <pathelement location=”C:/Dev/XCS/lib/commons-fileupload-1.0.jar”/>
    <pathelement location=”C:/Dev/XCS/lib/javax.servlet.jar”/>
    <pathelement location=”C:/Dev/XCS_Web_Common/classes”/>
    <pathelement location=”C:/jakarta-tomcat-4.1.27/shared/lib/c3p0-0.8.jar”/>
    <pathelement location=”C:/jakarta-tomcat-4.1.27/shared/lib/hibernate2.jar”/>
    <pathelement location=”C:/jakarta-tomcat-4.1.27/shared/lib/commons-lang.jar”/>
    <pathelement location=”C:/jakarta-tomcat-4.1.27/shared/lib/commons-fileupload-1.0.jar”/>
    <pathelement location=”C:/Dev/DCL_Web/DCL obclasses”/>
    <fileset dir=”/E:/MyEclipseIde030702/eclipse/plugins/com.genuitec.jboss.ide.eclipse.xdoclet.core_3.7.2/”>
    <include name=”*.jar”/>
    </fileset>
    </path>
    <target name=”_generation_” depends=”N10004″/>
    <target name=”N10004″ description=”Standard Hibernate”>
    <taskdef classpathref=”xdoclet.classpath” classname=”xdoclet.modules.hibernate.HibernateDocletTask” name=”hibernatedoclet”/><hibernatedoclet excludedTags=”@version,@author,@todo,@see” destDir=”webroot/WEB-INF/classes” force=”true” verbose=”true” addedTags=”@xdoclet-generated at ${TODAY},@copyright The XDoclet Team,@author XDoclet,@version ${version}” >
    <fileset dir=”src” includes=”**/*.java” >
    </fileset>
    <hibernate version=”2.0″ >
    </hibernate>
    </hibernatedoclet></target>
    </project>

    #206856 Reply

    BJ Hellstrom
    Member

    Tried these tags – nothing gets generated with them either.

    /**
    * @hibernate.class table=”request”
    */

    /**
    * @hibernate.id
    * column = “id”
    * generator-class = “native”
    */

    /**
    * @hibernate.property column=”ipaddr”
    */

    /**
    * @hibernate.property column=”jvm”
    */

    /**
    * @hibernate.property column=”password”
    */

    /**
    * @hibernate.property column=”time”
    */

    /**
    * @hibernate.property column=”tmpFileName”
    */

    /**
    * @hibernate.property column=”uploadFileName”
    */

    #206869 Reply

    Greg
    Member

    bjh,

    Thanks for the info. The first thing according to the xdoclet output, it is not finding your java src file that has the xdoclet tags in it. Is this file under the “src” directory. When running xdoclet you should see output like the following if it finds your hibernate source file:

    
    N10004:
    [hibernatedoclet] (XDocletMain.start                   47  ) Running <hibernate/>
    [hibernatedoclet] Generating mapping file for test.hibernate.Animal.
    [hibernatedoclet] test.hibernate.Animal
    _generation_:
    BUILD SUCCESSFUL
    #206875 Reply

    BJ Hellstrom
    Member

    the src directory is the root of a large package directory tree. there are no source files in the src directory. they are all in nested directories. the

    <fileset includes=”**/*.java” …

    (which is generated by MyEclipse) is supposed to recurse into the src package tree. In the Animals example, there is a single directory specified –

    <include name=”test/hibernate/*.java”/>

    so… the fileset does not work?

    #206877 Reply

    Greg
    Member

    The fileset **/*.java should work fine. I noticed the destDir for the hibernatedoclet is set to webroot/WEB-INF/classes folder. ME 3.7.x by default hides the classes directory in the ME perspective. If you switch to resource prespective you can see the classes directory. Are you sure the hibernate files aren’t being output into this directory?

    Just FYI, xdoclet will not complain if the output directory path doesn’t exist. It will just not generate the files and do so without warning. Also, I would not recommend outputing the hibernate files in the classes directory, since all the files in that directory can be deleted by eclipse builders. But any hibernate files in the src directory will be transferred to the output classes directory.

    #206881 Reply

    BJ Hellstrom
    Member

    lol. at this point i’m not worried about where the xdoclets are put because xdoclet never generates any.

    i spent hours hacking the xdoclet-build file — outside of eclipse. tried every possible permutation of filenames, including full paths to the specific java source with embedded doclet. nothing works. and there are no error messages.

    xdoclet is crap.

    #220105 Reply

    jethro1331
    Member

    Ditto on the xdoclet is crap. Mine couldn’t find the source at all, either. Just kept giving me that worthless error message “#47”. Finally, I cut and pasted my source file all the way up and down the directory tree so that a copy was in every directory! Still couldn’t find it or give me an error message.

    This tool is too immature. Why don’t the the authors put some error messages in before they release it.

    My rule of thumb is that if I have to screw around with the tool for as long as I could have written the prototype, then it’s not a tool, it’s a ball and chain.

    #220459 Reply

    urlgrrrl
    Member

    Hi, bjh —
    I just reproduced your problem — it’s the specification of the Java source directory: <fileset dir=”src” includes=”**/*.java” >

    I have a similar configuration where directory “src” has a variety of subdirectories under it, each of which is the true root of the Java packages. In my case, only one of the package root directories contains the source files of interest to Hibernate, so I specify: <fileset dir=”src/dao” includes=”**/*.java”>

    The following do NOT work at all:
    <fileset dir=”src” …> and <fileset dir=”src/dao/com” …> and <fileset dir=”src/dao;src/test” …>

    I’m not an Ant Task expert, so I don’t know if this is a fault of the task or not, but clearly xdoclet wants a single package root directory in the <fileset> tag.

    Hope this helps.

    #220494 Reply

    Scott Anderson
    Participant

    Thank you very much for the followup as I’m sure it will help others that search and find this thread.

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: XDoclet / Hibernate [Closed]

You must be logged in to post in the forum log in