ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romanas" <roma...@kryptis.lt>
Subject taskdef class xdoclet.ejb.EjbDocletTask cannot be found
Date Mon, 17 Nov 2003 18:25:25 GMT
Hi!

I'm a newbie with Ant!

I'm trying to build an example application. But this error is halways happens. I've tried
to add relative jars to CLASSPATH, to put the jars to c:/ant/lib, to change taskdef's classpath
element, etc. But nothing changes. Please, help!

The build.xml file and the output of ant are below.

The build.xml file is :

<?xml version="1.0"?>
<!-- ======================================================================= -->
<!-- Template build file                                                              
                -->
<!-- ======================================================================= -->

<project name="rot" default="main" basedir=".">
   <property environment="env"/>
   
   <!--
      Give user a chance to override without editing this file 
      (and without typing -D each time they run it)
   -->
   <property file=".ant.properties" />
   <property file="${user.home}/.ant.properties" />
   
   <property name="Name" value="Rot"/>
   <property name="version" value="1.0"/>
   
   <target name="check-jboss" unless="jboss.home">
      <fail>
         Property "jboss.home" is not set. Please use the file
         ".ant.properties" in this directory ${basedir} to
         set this property. It must point to the directory which
         contains the following directory: "deploy", "conf", "tmp"
         etc.
      </fail>
   </target>
   
   <target name="wrong-jboss" unless="jboss.present">
      <fail>
         Property "jboss.home" is set but it does not seem
         to point to the right directory. The file "run.jar"
         must be available at ${jboss.home}/bin.
      </fail>
   </target>
   
   <target name="check-xdoclet" unless="xdoclet.home">
      <fail>
         Property "xdoclet.home" is not set. Please use the file
         ".ant.properties" in this directory ${basedir} to
         set this property. It must point to the root directory of
         XDoclet distribution.
      </fail>
   </target>
   
   <target name="wrong-xdoclet" unless="xdoclet.present">
      <fail>
         Property "xdoclet.home" is set but it does not seem
         to point to the right directory. The file "xdoclet.jar"
         must be available at ${xdoclet.home}/lib.
      </fail>
   </target>
   
   <target name="check-xdoclet-ejb-module" unless="xdoclet.home">
      <fail>
         Property "xdoclet.home" is not set. Please use the file
         ".ant.properties" in this directory ${basedir} to
         set this property. It must point to the root directory of
         XDoclet distribution.
      </fail>
   </target>
   
   <target name="wrong-xdoclet-ejb-module" unless="xdoclet.presentejb">
      <fail>
         Property "xdoclet.home" is set but it does not seem
         to point to the right directory. The file "xdoclet-ejb-module-1.2b4.jar"
         must be available at ${xdoclet.home}/lib.
      </fail>
   </target>
   
   
   <target name="check-environment">
      <antcall target="check-jboss"/>
      <available property="jboss.present" file="${jboss.home}/bin/run.jar"/>
      <antcall target="wrong-jboss"/>
      <antcall target="check-xdoclet"/>
      <available property="xdoclet.present" file="${xdoclet.home}/lib/xdoclet-1.2b4.jar"/>
   <antcall target="wrong-xdoclet"/>
   <antcall target="check-xdoclet-ejb-module"/>
      <available property="xdoclet.presentejb" file="${xdoclet.home}/lib/xdoclet-ejb-module-1.2b4.jar"/>
      <antcall target="wrong-xdoclet-ejb-module"/>
   </target>
   
   <target name="init" depends="check-environment">
      <echo message="build.compiler = ${build.compiler}"/>
      <echo message="user.home = ${user.home}"/>
      <echo message="java.home = ${java.home}"/>
      <echo message="ant.home = ${ant.home}"/>
      <echo message="jboss.home = ${jboss.home}"/>
      <echo message="xdoclet.home = ${xdoclet.home}"/>
      <echo message="java.class.path = ${java.class.path}"/>
      <echo message="xdoclet.present = ${xdoclet.present}"/>
      <echo message="xdoclet.presentejb = ${xdoclet.presentejb}"/>
         
      <available property="jdk1.3+" classname="java.lang.StrictMath" />
   </target>
   
   <property name="jboss.lib" value="${jboss.home}/lib" />
   <property name="jboss.client" value="${jboss.home}/client" />
   <!-- Configuration used on JBoss 3 to run your server. There must be
        a directory with the same name under "${jboss.home}/server" -->
   <property name="jboss.configuration" value="default" />
   <property name="jboss.deploy" value="${jboss.home}/server/${jboss.configuration}/deploy"
/>
   <property name="src.dir" value="${basedir}/src"/>
   <property name="src.main.dir" value="${src.dir}/main"/>
   <property name="src.client.dir" value="${src.main.dir}/client"/>
   <property name="src.ejb.dir" value="${src.main.dir}/ejb"/>
   <property name="src.servlet.dir" value="${src.main.dir}/servlet"/>
   <property name="src.resources.dir" value="${src.dir}/resources"/>
   <property name="src.web.dir" value="${src.dir}/web"/>
   <property name="src.etc.dir" value="${src.dir}/etc"/>
   <property name="lib.dir" value="${basedir}/lib"/>
   <property name="build.dir" value="${basedir}/build"/>
   <property name="build.tmp.dir" value="${build.dir}/tmp"/>
   <property name="build.deploy.dir" value="${build.dir}/deploy"/>
   <property name="build.generate.dir" value="${build.dir}/generate"/>
   <property name="build.classes.dir" value="${build.dir}/classes"/>
   <property name="build.war.dir" value="${build.dir}/war"/>
   <property name="build.client.dir" value="${build.dir}/client"/>
   <property name="build.bin.dir" value="${build.dir}/bin"/>
   <property name="build.javadocs.dir" value="${build.dir}/docs/api"/>
   
   <path id="xdoclet.path">
      <pathelement location="${ant.home}/lib/ant.jar" />
<!-- AS Maybe necessary for Ant 1.5 and XDoclet 1.3
      <pathelement location="${ant.home}/lib/xmlParserAPIs.jar" />
      <pathelement location="${ant.home}/lib/xercesImpl.jar" />
      <pathelement location="${ant.home}/lib/bcel.jar" />
      <pathelement location="${xdoclet.home}/lib/xjavadoc.jar" />
-->
      
      <pathelement location="${xdoclet.home}/lib/xdoclet-1.2b4.jar" />
      <pathelement location="${xdoclet.home}/lib/xdoclet-ejb-module-1.2b4.jar" />
      <pathelement location="${jboss.client}/log4j.jar" />
   </path>
   
   <path id="base.path">
      <path refid="xdoclet.path"/>
      <pathelement location="${jboss.client}/jboss-j2ee.jar" />
      <pathelement location="${jboss.client}/jnp-client.jar" />
      <pathelement location="${jboss.client}/jbossmq-client.jar" />
      <pathelement location="${jboss.client}/jbosssx-client.jar" />
      <pathelement location="${jboss.client}/concurrent.jar" />
      <pathelement location="${jboss.client}/jaas.jar" />
      <pathelement location="${jboss.lib}/jboss-jmx.jar" />
      <pathelement location="${jboss.home}/server/${jboss.configuration}/lib/jbosssx.jar"
/>
      <pathelement location="${jboss.home}/server/${jboss.configuration}/lib/mail.jar"
/>
      <pathelement location="${build.classes.dir}" />
   </path>
   
   <!-- =================================================================== -->
   <!-- Generates the necessary EJB classes and deployment descriptors      -->
   <!-- =================================================================== -->
   
   <target name="xdoclet-generate" depends="init">
      <taskdef
         name="ejbdoclet"
<!-- The error is always here -->
         classname="xdoclet.ejb.EjbDocletTask"
          classpathref="xdoclet.path">
     </taskdef>      
      
      <ejbdoclet
         sourcepath="${src.ejb.dir}"
         destdir="${build.generate.dir}"
         classpathref="base.path"
         excludedtags="@version,@author"
         ejbspec="1.1"
         mergedir="${src.resources.dir}/xdoclet"
         force="${xdoclet.force}"
      >
         <fileset dir="${src.ejb.dir}">
            <include name="**/*EJB.java"/>
         </fileset>
         
         <packageSubstitution packages="session,entity" substituteWith="interfaces"/>
         <dataobject/>
         <remoteinterface/>
         <homeinterface/>
         <entitypk/>
         <entitybmp/>
         <entitycmp/>
         <deploymentdescriptor destdir="${build.dir}/META-INF"/>
         <!-- AS 4/29/02 Do not validate XML files because JBoss 3.0 message driven will
              report an wrong error because it uses the wrong jboss.dtd -->
         <jboss version="${jboss.version}"
            xmlencoding="UTF-8"
            typemapping="${type.mapping}"
            datasource="${datasource.name}"
            destdir="${build.dir}/META-INF"
            validateXml="true"
         /> <!-- dlt 08/03/2003 -->
      </ejbdoclet>
   </target>
   
   <!-- =================================================================== -->
   <!-- Compiles the source code                                            -->
   <!-- =================================================================== -->
   
   <target name="compile" depends="xdoclet-generate">
      <mkdir dir="${build.classes.dir}"/>
      <javac
         destdir="${build.classes.dir}"
         debug="on"
         deprecation="off"
         optimize="on"
         classpathref="base.path"
      >
         <src path="${src.ejb.dir}"/>
         <src path="${build.generate.dir}"/>
      </javac>
      <javac
         srcdir="${src.client.dir}"
         destdir="${build.classes.dir}"
         debug="on"
         deprecation="off"
         optimize="on"
         includes="**/*.java"
         classpathref="base.path"
      >
      </javac>
   </target>
   
   <!-- =================================================================== -->
   <!-- Creates the jar archives                                            -->
   <!-- =================================================================== -->
   
   <target name="jar" depends="compile">
      <mkdir dir="${build.deploy.dir}"/>
      <mkdir dir="${build.client.dir}"/>
      <mkdir dir="${build.bin.dir}"/>
      <jar
         jarfile="${build.deploy.dir}/ejb-rotmachine.jar"
      >
         <fileset
            dir="${build.classes.dir}"
            includes="org/rotmachine/entity/**,org/rotmachine/session/**,org/rotmachine/message/**,org/rotmachine/interfaces/**,org/rotmachine/util/**"
         >
         </fileset>
         <fileset
            dir="${build.dir}"
            includes="META-INF/**"
         >
         </fileset>
      </jar>
      <jar
         jarfile="${build.client.dir}/client-rotmachine.jar"
      >
         <fileset
            dir="${build.classes.dir}"
            includes="org/rotmachine/interfaces/**,org/rotmachine/client/**"
         >
         </fileset>
      </jar>
   </target>
   
   <!-- =================================================================== -->
   <!-- Compiles the WEB source code                                        -->
   <!-- =================================================================== -->
   
   <target name="compile-web" depends="compile" if="servlet-lib.path">
      <mkdir dir="${build.war.dir}"/>
      <path id="web.path">
         <path refid="base.path"/>
         <pathelement location="${servlet-lib.path}"/>
      </path>
      <javac
         destdir="${build.war.dir}"
         debug="on"
         deprecation="off"
         optimize="on"
         classpathref="web.path"
      >
         <src path="${src.servlet.dir}"/>
      </javac>
   </target>
   
   <!-- =================================================================== -->
   <!-- Creates the war archives                                            -->
   <!-- =================================================================== -->
   
   <target name="war" depends="compile-web" if="servlet-lib.path">
      <mkdir dir="${build.deploy.dir}"/>
      <copy todir="${build.war.dir}/WEB-INF">
         <fileset dir="${src.etc.dir}/WEB-INF" includes="jboss-web.xml"/>
      </copy>
      <war
         warfile="${build.deploy.dir}/rotmachine.war"
         webxml="${src.etc.dir}/WEB-INF/web.xml"
      >
         <fileset dir="${src.web.dir}"/>
         <fileset dir="${build.war.dir}"/>
         <classes dir="${build.classes.dir}" includes="org/rotmachine/interfaces/**"/>
      </war>
   </target>
   
   <!-- =================================================================== -->
   <!-- Creates the client binary                                           -->
   <!-- =================================================================== -->
   
   <target name="deploy-server" depends="jar,war">
      <copy todir="${jboss.deploy}">
         <fileset dir="${build.deploy.dir}" includes="*.jar,*.war,*.ear">
         </fileset>
      </copy>
   </target>
   
   <!-- =================================================================== -->
   <!-- Creates the client binary                                           -->
   <!-- =================================================================== -->
   
   <target name="create-client" depends="jar">
      <!-- Convert the given paths to Windows -->
      <pathconvert targetos="windows" property="jboss.home.on.windows" >
         <path>
            <pathelement location="${jboss.home}" />
         </path>
      </pathconvert>
      <pathconvert targetos="windows" property="java.home.on.windows" >
         <path>
            <pathelement location="${java.home}" />
         </path>
      </pathconvert>
      <!-- Convert the given paths to Unix -->
      <pathconvert targetos="unix" property="jboss.home.on.unix" >
         <path>
            <pathelement location="${jboss.home}" />
         </path>
      </pathconvert>
      <pathconvert targetos="unix" property="java.home.on.unix" >
         <path>
            <pathelement location="${java.home}" />
         </path>
      </pathconvert>
      <echo message="JBoss Home on Unix: ${jboss.home.on.unix}"/>
      <echo message="Java Home on Unix: ${java.home.on.unix}"/>
      <filter token="jboss.home" value="${jboss.home.on.windows}"/>
      <filter token="java.home" value="${java.home.on.windows}"/>
      <copy todir="${build.bin.dir}" filtering="yes">
         <fileset dir="${src.etc.dir}/bin" includes="run-*client.bat">
         </fileset>
      </copy>
      <copy file="${src.etc.dir}/bin/lcp.bat" todir="${build.bin.dir}"/>
      <filter token="jboss.home" value="${jboss.home.on.unix}"/>
      <filter token="java.home" value="${java.home.on.unix}"/>
      <copy todir="${build.bin.dir}" filtering="yes">
         <fileset dir="${src.etc.dir}/bin" includes="run-*client.sh">
         </fileset>
      </copy>
      <copy file="${src.etc.dir}/jndi.properties" todir="${build.bin.dir}"/>
   </target>
   
   <!-- =================================================================== -->
   <!-- Creates the binary structure                                        -->
   <!-- =================================================================== -->
   
   <target name="main" depends="deploy-server,create-client">
   </target>

   <!-- =================================================================== -->
   <!-- Cleans up the current build                                         -->
   <!-- =================================================================== -->
   
   <target name="clean" depends="init">
      <delete dir="${build.dir}"/>
   </target>

</project>


The output of ANT is :

check-environment:

check-jboss:

wrong-jboss:

check-xdoclet:

wrong-xdoclet:

check-xdoclet-ejb-module:

wrong-xdoclet-ejb-module:

init:
     [echo] build.compiler = ${build.compiler}
     [echo] user.home = C:\WINDOWS
     [echo] java.home = C:\J2SDK1.4.1_02\JRE
     [echo] ant.home = c:\ant
     [echo] jboss.home = c:\jboss 
     [echo] xdoclet.home = c:\xdoclet
     [echo] java.class.path = c:\ant\lib\xml-apis.jar;c:\ant\lib\xercesImpl.jar;c:\ant\lib\optional.jar;c:\ant\lib\ant.jar;c:\tomcat\common\lib;c:\tomcat\common\classes;c:\tomcat\common\lib\servlet.jar;c:\j2sdk1.4.1_02\lib;c:\j2sdk1.4.1_02\lib\tools.jar;c:\jboss\bin\run.jar;c:\ant\lib\ant.jar;c:\ant\lib\xercesImpl.jar;c:\ant\lib;.;c:\ant\lib\xml-apis.jar;c:\xdoclet\lib;.;c:\j2sdk1.4.1_02\lib\tools.jar
     [echo] xdoclet.present = true
     [echo] xdoclet.presentejb = true

xdoclet-generate:

BUILD FAILED
file:c:/rotmachine/build.xml:161: taskdef class xdoclet.ejb.EjbDocletTask cannot be found

Total time: 3 seconds



Thanks in advance.

Roman.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message