facebook

XDOCLET – subtask problem

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #225996 Reply

    peerly
    Member

    I get this error when I run a build file, funny thing is it worked perfectly till now, don’t know what I’m doing wrong:

    
    Buildfile: C:\eclips\workspace\JasperHibernate-Xdoc\build.xml
    compile:
    generate:
    BUILD FAILED: C:\eclips\workspace\JasperHibernate-Xdoc\build.xml:60: Can't create a hibernate element under hibernatedoclet. Make sure the jar file containing the corresponding subtask class is on the classpath specified in the <taskdef> that defined {2}. 
    Total time: 1 second
    

    This is my build file, fairly simplistic

    
    <?xml version="1.0" encoding="UTF-8"?>
    <project name="project" default="generate" basedir="." >
        <description>
                description
        </description>
        <property name="lib.home" location="${basedir}/lib">
        </property>
        <property name="generated.home" location="${basedir}/data">
        </property>
        <property name="generated.forced" value="true">
        </property>
        <property name="src.home" location="${basedir}/src">
        </property>
        <property name="build.home" location="${basedir}">
        </property>
        <property name="compile.debug" value="false" />
        <property name="compile.deprecation" value="false" />
        <property name="compile.optimize" value="true" />
    
        <target name="compile" >
            <javac srcdir="./data" destdir="./data">
            </javac>
        </target>
    
    
        <target name="generate" 
                description="Generates Hibernate class descriptor files."
                >
    
            <!-- Define the hibernatedoclet task -->
            <taskdef name="hibernatedoclet"
                classname="xdoclet.modules.hibernate.HibernateDocletTask">
                <classpath>
                    <fileset dir="${lib.home}/xdoclet">
                        <include name="*.jar"/>
                    </fileset>
                </classpath>
            </taskdef>
    
            <!-- Execute the hibernatedoclet task -->
            <hibernatedoclet
                destdir="${generated.home}"
                excludedtags="@version,@author,@todo"
                force="${generated.forced}"
                mergedir="${generated.home}"
                verbose="false">
            
                <fileset dir="${src.home}">
                    <include name="*.java"/>
                </fileset>
            
                <hibernate/>
            
            </hibernatedoclet>
    
    
            <replace dir="${generated.home}">
                <include name="**/hibernate/*.hbm.xml"/>
                <replacefilter token="readonly=" value="inverse="/>
                <replacefilter token="role=" value="name="/>
                <replacefilter token="hibernate-mapping.dtd" value="hibernate-mapping-2.0.dtd"/>
            </replace>
    
        </target>
    </project>
    
    #226023 Reply

    Riyad Kalla
    Member

    Looks like the JAR file containing the hibernatedoclet (class: xdoclet.modules.hibernate.HibernateDocletTask), is not being found. Try going to your Window > Prefs > MyEclipse > XDoclet and hitting Refresh button, then go down one more level to Code Assist and hit refresh there as well.

    Then try the build, does it work? Are you using MyEclipse > Run XDoclet to run the build script or are you running it AS an Ant run target? If you are running it as an Ant script, then you need to setup the classpath for all the JARs yourself, we suggest that you just let MyEclipse do all this automatically for you.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: XDOCLET – subtask problem

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