Hi,
I have been spending some time trying to figure out
why xdoclet does not generate anything w. regard to the EJBdoclet task. It
looks as if it does not find the right source path, but if I put in echo's in a
dummy "test" task, the path looks OK. I have been compiling, jarring,
earing and deploying using this ant build successfully so that's not the
problem.. I am including the debug lg, but there seems to be nothing there, no
way of knowing what the source or destination dirs are in the ejbdoclet
task.
I am using ant 1.5.4. and Xdoclet 1.2.
Below is the tail end of the debug output
(everything seemed to go fine prior to that), build properties file, the ant
build file and the source.
<------------------ Debug output
--------------->
Finding class
org.apache.log4j.spi.LocationInfo
Class org.apache.log4j.spi.LocationInfo loaded from ant loader Class java.io.StringWriter loaded from parent loader Class java.io.PrintWriter loaded from parent loader Finding class com.ibm.uvm.tools.DebugSupport [ejbdoclet] (XDocletMain.start 47 ) Running <homeinterface/> Finding class xjavadoc.XJavaDoc$NoInnerClassesPredicate Class xjavadoc.XJavaDoc$NoInnerClassesPredicate loaded from ant loader Finding class org.apache.commons.collections.CollectionUtils Class org.apache.commons.collections.CollectionUtils loaded from ant loader Class java.util.NoSuchElementException loaded from parent loader Class java.lang.NullPointerException loaded from parent loader Class java.util.AbstractCollection loaded from parent loader Finding class org.apache.commons.collections.CollectionUtils$EmptyIterator Class org.apache.commons.collections.CollectionUtils$EmptyIterator loaded from ant loader [ejbdoclet] (XDocletMain.start 47 ) Running <remoteinterface/> [ejbdoclet] (XDocletMain.start 47 ) Running <deploymentdescriptor/> Resource xdoclet/modules/ejb/dd/resources/ejb20-jar.dtd loaded from ant loader Finding class xdoclet.template.TemplateParser Class xdoclet.template.TemplateParser loaded from ant loader Finding class xdoclet.util.FileManager Class xdoclet.util.FileManager loaded from ant loader Class java.io.FileNotFoundException loaded from parent loader Finding class xdoclet.template.TemplateEngine$TagContext Class xdoclet.template.TemplateEngine$TagContext loaded from ant loader Resource xdoclet/modules/ejb/dd/resources/ejb-body.xdt loaded from ant loader Finding class xdoclet.template.PrettyPrintWriter Class xdoclet.template.PrettyPrintWriter loaded from ant loader Couldn't load Resource ejb-env-entries-{0}.xml Couldn't load Resource ejb-ejbrefs-{0}.xml Resource xdoclet/modules/ejb/dd/resources/ejb-ref.xdt loaded from ant loader Resource xdoclet/modules/ejb/dd/resources/res-ref.xdt loaded from ant loader Couldn't load Resource ejb-resourcerefs-{0}.xml Couldn't load Resource ejb-resource-env-refs-{0}.xml Couldn't load Resource ejb-destinationrefs-{0}.xml Couldn't load Resource ejb-destinationrefs-{0}.xml Couldn't load Resource ejb-sec-rolerefs-{0}.xml Resource xdoclet/modules/ejb/dd/resources/res-ref.xdt loaded from ant loader Finding class xjavadoc.XParameter Class xjavadoc.XParameter loaded from ant loader Couldn't load Resource ejb-finders-{0}.xml Couldn't load Resource session-beans.xml Resource xdoclet/modules/ejb/dd/resources/ejb-body.xdt loaded from ant loader Couldn't load Resource entity-beans.xml Class sun.reflect.MethodAccessorImpl loaded from parent loader Resource xdoclet/modules/ejb/dd/resources/ejb-body.xdt loaded from ant loader Couldn't load Resource message-driven-beans.xml Resource xdoclet/modules/ejb/dd/resources/relationships.xdt loaded from ant loader Couldn't load Resource relationships.xml Couldn't load Resource relationships.xml Resource xdoclet/modules/ejb/dd/resources/asm-descriptor.xdt loaded from ant loader Couldn't load Resource assembly-descriptor.xml Couldn't load Resource ejb-security-roles.xml Couldn't load Resource ejb-method-permissions.ent Couldn't load Resource ejb-container-transactions.ent Couldn't load Resource ejb-message-destinations.ent Couldn't load Resource ejb-exclude-list.xml BUILD SUCCESSFUL
<------------------ Debug output
---------------> <-------------------- Ant build file portion of
contents --------------->
<project
name="aptsiframeworks" default="deploy" >
<!-- Standard build properties --> <property file="build.properties"/> <!-- XDoclet related properties begins --> <!-- XDoclet Jar location --> <property name="xdoclet.root.dir" value="C:\aptsi_home\xdoclet\xdoclet-bin-1.2.3\xdoclet-1.2.3\"/> <property name="xdoclet.lib.dir" value="C:\aptsi_home\xdoclet\xdoclet-bin-1.2.3\xdoclet-1.2.3\lib"/> <!-- Not sure
if this samples jar is needed
-->
<property name="xdoclet.samples.lib.dir" value="${xdoclet.root.dir}/samples/lib"/> <property name="xdoclet.log4j.dir" value="C:\aptsi_home\xdoclet\xdoclet-bin-1.2.3\xdoclet-1.2.3\"/> <!-- property file="${xdoclet.root.dir}/build.properties"/--> <!-- XDoclet related properties end --> <!-- XDoclet gen interfaces, etc., reside
in gen-src -->
<property name="gen-src.dir" value="${dir.buildroot}/gen-src"/> <property name="gen-src.ejb.interfaces.dir" value="${gen-src.dir}/ejb/interfaces"/> <property name="gen-src.ejb.meta-inf.dir" value="${gen-src.dir}/META-INF"/> <!-- =================================================================== --> <!-- Define the class path XDoclet --> <!-- =================================================================== --> <path id="xdoclet.classpath"> <fileset dir="${xdoclet.lib.dir}/"> <include name="*.jar"/> </fileset> <fileset dir="${xdoclet.samples.lib.dir}/"> <include name="*.jar"/> </fileset> </path>
<taskdef
name="ejbdoclet"
classname="xdoclet.modules.ejb.EjbDocletTask" classpathref="xdoclet.classpath"/> <!-- =================================================================== --> <!-- Target for the EJBdoclet task to generate EJB inerface --> <!-- =================================================================== --> <target name="ejbdoclet" depends="prepare"> <ejbdoclet destdir="${gen-src.dir}" excludedtags="@version,@author" verbose="true" ejbspec="2.0"> <fileset dir="${application.dir}"> <include name="/ejb/*Bean.java"/> </fileset>
<homeinterface/>
<remoteinterface/>
<deploymentdescriptor
destdir="${gen-src.ejb.meta-inf.dir}"/>
</ejbdoclet> </target> <!-- Test: -check that we get correct properties --> <target name="test-properties" > <echo message="classpath ${xdoclet.root.dir}lib "/> <echo message="ejb.dir ${ejb.dir}"/> <echo message="classpath ${gen-src.dir}"/> <echo message="classpath ${dir.build.ejb}"/> <echo message="classpath ${ejb.dir}/gen-src"/> <echo message="classpath ${dir.build.ejb}"/> </target> <!-- Clean: delete all built
binaries
-->
<target name="clean" description="Remove all generated files"> <delete dir="${dir.build}"/> <delete dir="${dir.assemble}"/> <delete dir="${ejb.dir}/gen-src"/> <delete dir="${gen-src.dir}"/> </target> <!-- Prepare: Creates the output directories --> <target name="prepare"> <echo message="classpath ${dir.lib} "/> <mkdir dir="${dir.build}"/> <mkdir dir="${dir.build.common}"/> <mkdir dir="${dir.assemble}"/> <mkdir dir="${dir.dist}"/> <!-- Create common classes directories --> <mkdir dir="${jarDir}"/> <!-- Create ejb and classes directories --> <mkdir dir="${dir.build.ejb}"/> <mkdir dir="${dir.build.ejb}/META-INF"/> <!-- Create for interface generated source --> <mkdir dir="${gen-src.dir}"/> <!-- Create Web-inf and classes directories --> <mkdir dir="${warDir}/WEB-INF"/> <mkdir dir="${warDir}/WEB-INF/classes"/> <mkdir dir="${warDir}/WEB-INF/lib"/> <!-- Create Meta-inf and classes directories --> <mkdir dir="${earDir}/META-INF"/> </target> <------------------- End Ant Build File section
--->
<------------------ Build Properties
--------------------->
dir.src="">dir.lib=src/java/lib
dir.buildroot=./build dir.build=${dir.buildroot}/classes dir.build.common=${dir.build}/common dir.build.ejb=${dir.build}/ejb dir.assemble=${dir.buildroot}/assemble dir.deploydir=C:\aptsi_home\jboss\jboss-3.2.3\server\default\deploy
applicationName=tsm application.dir=${dir.src}applications/${applicationName} dirs.base=${basedir} warclassdir=${application.dir}/web/WEB-INF/classes
libdir=${application.dir}/web/WEB-INF/lib appDDDir=${application.dir}/META-INF/ warDD=${application.dir}/web/WEB-INF java.dir=${basedir}/aptsi
warFile=${applicationName}.war earFile=${applicationName}.ear jarFile=${applicationName}.jar earDir=${dir.assemble}/ear
warDir=${dir.assemble}/war ejbDir=${dir.assemble}/ejb jarDir=${dir.assemble}/jars earAppDDDir=${earDir}/META-INF/ web.dir=${application.dir}/web ejb.dir=${application.dir}/ejb common.dir=${application.dir}/common <------------------ End Build Properties
--------------------->
<----------------- Source Hello World Bean file
---------------->
/*
* TSM - Testing Service Manager Version @version * * Copyright 2005 Applied Tehcnology Solutions, Inc. * Bloomfield Twp, Michigan 48302, U.S.A. * All rights reserved. */ package com.aptsi.applications.tsm.ejb; import java.sql.Timestamp;
import java.util.ArrayList; import java.util.Collection; import java.util.TreeMap; import javax.ejb.*; import javax.sql.DataSource; import org.apache.log4j.Logger;
/**
* Sample Implementation of the Server Side EJB * * @author <a href=""mailto:nikhil">mailto:nikhil at app-tech-solns.com">Nikhil Kumar</a> * @created December 10, 2005 * @version 1.0 * @ejb.bean * name="HelloWorldBean" * jndi-name="/tsm/HelloWorldSession" * view-type="remote" * type="Stateless" */ public abstract class HelloWorldBean implements SessionBean { private static final Logger log = Logger.getLogger( HelloWorldSession.class ); private transient
SessionContext sessionContext = null;
// Your business logic goes here
/**
* Your Logic. * * @ejb.interface-method view-type="remote" */ public String helloWorld() { return "Hello World"; }
/** * Set the associated session context. The container invokes this method on * an instance after the instance has been created. <p> * * This method is called with no transaction context. * * @param sessionContext A SessionContext interface for the instance. The * instance should store the reference to the context * in an instance variable. **/ public void setSessionContext( SessionContext sessionContext ) { this.sessionContext = sessionContext; } /**
* Create the Session Bean * * @exception CreateException If an error occurs which will not allow creation to complete * @ejb.create-method **/ public void ejbCreate() throws CreateException { log.debug( "ejbCreate()" ); } /** * A container invokes this method before it ends the life of the session * object. This happens as a result of a client's invoking a remove * operation, or when a container decides to terminate the session object * after a timeout. <p> * * This method is called with no transaction context. **/ public void ejbRemove() { log.info( security + " logged out" ); } /** * The activate method is called when the instance is activated from its * "passive" state. The instance should acquire any resource that it has * released earlier in the ejbPassivate() method. <p> * * This method is called with no transaction context. **/ public void ejbActivate() { } /** * The passivate method is called before the instance enters the "passive" * state. The instance should release any resources that it can re-acquire * later in the ejbActivate() method. <p> * * After the passivate method completes, the instance must be in a state * that allows the container to use the Java Serialization protocol to * externalize and store away the instance's state. <p> * * This method is called with no transaction context. **/ public void ejbPassivate() { log.info( security + " logged out" ); } }
<----------------- Source Hello World Bean file
----------------> |
- [Xdoclet-user] ejbdolcet not generating nikhil
- Re: [Xdoclet-user] ejbdolcet not generating Andrew Stevens
- Re: [Xdoclet-user] ejbdolcet not generating nikhil
- [Xdoclet-user] more than one webdoclet in 1.2.3 Andrew Veliath