Hi,

I have a project with the following files:

appclient.registration. PatientSearchClient.java
ejb.registration. IPatientSearch.java
ejb.registration. PatientSearch.java
ejb.registration. PatientSearchHome.java
ejb.registration. PatientSearchBean.java
ejb.registration. LocalPatientSearch.java
ejb.registration. LocalPatientSearchHome.java

I have a build.xml which I modified to add a ejbdoclet section and it works fine when processed: 'ant all'

However the generated ejb-jar.xml and jboss.xml is practically devoid of anything useful - no ejb sections filled out with real content. And I expected the (Home)Interface java files to be generated in the generated directory - not the case.

Can anyone help me get this working?

Here is my related content:


1) PatientSearchBean.java_______________________________________________


package com.oshis.ejb.registration;

import javax.ejb.*;

/**
* This is a teller bean. It is an example of how to use the XDoclet tags.
*
* @ejb.bean         name="PatientSearch"
*                   description="PatientSearch example bean"
*                   jndi-name="ejb/bank/PatientSearch"
*                   type="Stateless"
*
* @ejb.security-role-ref role-link="admin"
*                        role-name="oshis-admin"
*
* @ejb.permission   role-name="oshis-admin"
*
* @ejb.transaction  type="Required"
* @ejb.transaction-type type="Container"
*
* @ejb.resource-ref res-auth="Container"
*                   res-name="jdbc/DBPool"
*                   res-type="javax.sql.DataSource"
*
* @soap.service    urn="PatientSearchService"
*
* @jboss.resource-ref res-ref-name="jdbc/DBPool"
*                     resource-name="MyDataSourceManager"
*
* @jboss.container-configuration name="Standard Stateless SessionBean"
*
* @jboss.ejb-ref-jndi jndi-name="ejb/bank/Account"
*                     ref-name="bank/Account"
*
* @weblogic.pool      initial-beans-in-free-pool="1"
*                     max-beans-in-free-pool="3"
*
* @weblogic.stateless-clustering stateless-bean-call-router-class-name="Whatever"
*                                stateless-bean-is-clusterable="True"
*                                stateless-bean-load-algorithm="Whazzup"
* stateless-bean-methods-are-idempotent="Sure"
*
* @websphere.bean timeout="239"
* @jonas.bean ejb-name="PatientSearch"
*             jndi-name="PatientSearchHome"
* @jonas.resource res-ref-name="jdbc/oshisDB"
*                 jndi-name="jdbc_1"
*
* @author <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
*/
public class PatientSearchBean implements SessionBean {

   private SessionContext context= null;

   public PatientSearchBean() {

   }


   /**
    * @ejb.create-method
    */
   public void ejbCreate() {

   }

   public void setSessionContext(SessionContext context) {
       this.context = context;
   }

   public void ejbRemove() {
   }

   public void ejbActivate() {
   }

   public void ejbPassivate() {
   }

   /**
    * Get patients
    *
    * @ejb.interface-method view-type="remote"
    */
   public String getPatients() {
       return "Greg Caulton";
   }

}




2) build.xml_______________________________________________

<project name="oshis" default="all" basedir=".">
   <property file="build.properties"/>

   <property name="lib.dir"   value="${basedir}/xdoclib"/>
   <property name="src.dir"   value="${basedir}/src"/>
   <property name="build.dir" value="${basedir}/build"/>
   <property name="generated.java.dir" value="${basedir}/generated"/>



   <!-- The classpath for running the client -->
   <path id="client.classpath">
       <pathelement location="${build.dir}"/>
       <fileset dir="${jboss.home}/client">
           <include name="**/*.jar"/>
       </fileset>
   </path>


   <!-- The build classpath -->
   <path id="build.classpath">
       <path refid="client.classpath"/>
        <fileset dir="${jboss.server}/lib/">
           <include name="javax.servlet*.jar"/>
       </fileset>
       <!-- for java2wsdl -->
        <fileset dir="${jboss.server}/deploy/jboss-ws4ee.sar/">
           <include name="*.jar"/>
       </fileset>
   </path>

   <!-- Hypersonic SQL classpath -->
   <path id="hsql.classpath">
       <pathelement location="${jboss.server}/lib/hsqldb.jar"/>
   </path>

<!-- =================================================================== --> <!-- Initialises the build. --> <!-- =================================================================== -->
   <target name="prepare">
       <mkdir dir="${build.dir}"/>
   </target>

<!-- ================================================================ --> <!-- Compiles the source code --> <!-- ================================================================ -->
   <target name="compile" depends="ejbdoclet">
       <javac destdir="${build.dir}" classpathref="build.classpath"
              debug="on">
           <src path="${src.dir}"/>
       </javac>
   </target>

<path id="project.class.path">
   <fileset dir="${lib.dir}">
       <include name="*.jar"/>
   </fileset>
</path>

<target name="ejbdoclet" depends="prepare">
   <taskdef
       name="ejbdoclet"
       classname="xdoclet.modules.ejb.EjbDocletTask"
       classpathref="project.class.path"
   />

   <tstamp>
       <format property="TODAY" pattern="d-MM-yy"/>
   </tstamp>

   <ejbdoclet
       destdir="${generated.java.dir}"
       excludedtags="@version,@author"
       addedtags="@xdoclet-generated at ${TODAY}"
       ejbspec="2.0"
   >
       <fileset dir="${src.dir}/com/oshis/ejb">
           <include name="**/*Bean.java"/>
       </fileset>

       <dataobject/>

       <packageSubstitution packages="ejb" substituteWith="interfaces"/>

       <remoteinterface />
       <localinterface />

       <homeinterface />
       <localhomeinterface/>

       <entitypk/>
       <entitycmp/>

       <deploymentdescriptor destdir="${build.dir}/ejb/META-INF"/>
       <jboss version="3.0"
           securityDomain="java:/jaas/samples"
           preferredRelationMapping="relation-table"
           datasource="java:/DefaultDS"
           datasourcemapping="Hypersonic SQL"
           destdir="${build.dir}/ejb/META-INF"
       />
   </ejbdoclet>
</target>


   <target name="package-ejb" depends="compile">
       <mkdir dir="jar" />
       <delete file="jar/oshis-ejb.jar"/>

       <jar jarfile="jar/oshis-ejb.jar">
           <metainf dir="dd/ejb" includes="**/*.xml" />

           <fileset dir="${build.dir}">
               <include name="com/oshis/ejb/**" />
           </fileset>
       </jar>
   </target>


   <target name="package-client" depends="compile">
       <mkdir dir="jar" />
       <copy todir="${build.dir}">
           <fileset dir="${src.dir}">
               <include name="**/appclient/*.properties"/>
           </fileset>
           <mapper type="flatten"/>
       </copy>
       <delete file="jar/app-client.jar"/>

       <jar jarfile="jar/app-client.jar">
           <metainf dir="dd/client" includes="*.xml"/>
           <fileset dir="${build.dir}">
               <include name="com/oshis/appclient/**"/>
           </fileset>
           <fileset dir="dd/client">
               <include name="jndi.properties"/>
           </fileset>
           <fileset dir="${src.dir}/com/oshis/">
               <include name="appclient/*.properties"/>
           </fileset>
       </jar>
   </target>


<!-- Creates an ear file containing the ejb jars and the web client war. -->
   <target name="assemble-app">
       <delete file="jar/oshis.ear"/>
       <ear destfile="jar/oshis.ear" appxml="dd/application.xml">
<fileset dir="jar" includes="*-ejb.jar,app-client.jar,*.war,*.wsr"/> <fileset dir="src" includes="users.properties,roles.properties"/>
       </ear>
   </target>

<!-- Deploys the EAR file by copying it to the JBoss deploy directory. -->
   <target name="deploy" depends="assemble-app">
       <copy file="jar/oshis.ear" todir="${jboss.server}/deploy"/>
   </target>

   <!-- Run the standalone client -->
   <target name="run-client">
       <echo>${java.class.path}</echo>
<java classname="com.oshis.appclient.registration.PatientSearchClient" fork="yes"> <jvmarg value="-Djava.security.auth.login.config=dd/client/auth.conf" />
           <classpath>
               <pathelement path="jar/app-client.jar"/>
               <path refid="client.classpath"/>
               <pathelement path="${java.class.path}"/>
           </classpath>
       </java>
   </target>

   <!-- Call the HSQL ScriptTool utility. -->
   <target name="db-schema">
       <java classname="org.hsqldb.util.ScriptTool" fork="yes">
           <arg value="-url"/>
           <arg value="jdbc:hsqldb:hsql:"/>
           <arg value="-database"/>
           <arg value="//localhost:1701"/>
           <arg value="-script"/>
           <arg value="sql/schema.sql"/>
           <classpath refid="hsql.classpath"/>
       </java>
   </target>

   <target name="clean">
      <delete dir="${build.dir}" />
      <mkdir dir="${build.dir}"  />

      <delete dir="dd/ws/wsdl" />
      <mkdir dir="dd/ws/wsdl" />
   </target>

   <target name="db-all" depends="db-schema" />
<target name="all" depends="compile,package-ejb,package-client,assemble-app,deploy" />

</project>



3) Output when running ant_____________________________________________

C:\ant\oshis>ant all
Buildfile: build.xml

prepare:

ejbdoclet:
[ejbdoclet] (XDocletMain.start                   47  ) Running <dataobject/>
[ejbdoclet] (XDocletMain.start 47 ) Running <remoteinterface/

[ejbdoclet] (XDocletMain.start 47 ) Running <localinterface/>

[ejbdoclet] (XDocletMain.start 47 ) Running <homeinterface/> [ejbdoclet] (XDocletMain.start 47 ) Running <localhomeinterfa
ce/>
[ejbdoclet] (XDocletMain.start                   47  ) Running <entitypk/>
[ejbdoclet] (XDocletMain.start                   47  ) Running <entitycmp/>
[ejbdoclet] (XDocletMain.start 47 ) Running <deploymentdescri
ptor/>
[ejbdoclet] (XDocletMain.start                   47  ) Running <jboss/>

compile:

package-ejb:
  [delete] Deleting: C:\ant\oshis\jar\oshis-ejb.jar
     [jar] Building jar: C:\ant\oshis\jar\oshis-ejb.jar

package-client:
  [delete] Deleting: C:\ant\oshis\jar\app-client.jar
     [jar] Building jar: C:\ant\oshis\jar\app-client.jar

assemble-app:
  [delete] Deleting: C:\ant\oshis\jar\oshis.ear
     [ear] Building ear: C:\ant\oshis\jar\oshis.ear

deploy:
[copy] Copying 1 file to C:\progra~1\jboss-4.0.3SP1\server\default\deploy

all:

BUILD SUCCESSFUL
Total time: 3 seconds


4) The *only* two files generated are ejb-jar.xml and jboss.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd";>

<ejb-jar >

  <description><![CDATA[No Description.]]></description>
  <display-name>Generated by XDoclet</display-name>

  <enterprise-beans>

     <!-- Session Beans -->
    <!--
To add session beans that you have deployment descriptor info for, add a file to your XDoclet merge directory called session-beans.xml that contains
      the <session></session> markup for those beans.
    -->

     <!-- Entity Beans -->
    <!--
      To add entity beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called entity-beans.xml that contains
      the <entity></entity> markup for those beans.
    -->

     <!-- Message Driven Beans -->
    <!--
To add message driven beans that you have deployment descriptor info for, add a file to your XDoclet merge directory called message-driven-beans.xml that contains
      the <message-driven></message-driven> markup for those beans.
    -->

  </enterprise-beans>

  <!-- Relationships -->

  <!-- Assembly Descriptor -->
    <!--
      To specify your own assembly descriptor info here, add a file to your
      XDoclet merge directory called assembly-descriptor.xml that contains
      the <assembly-descriptor></assembly-descriptor> markup.
    -->

  <assembly-descriptor >
    <!--
      To specify additional security-role elements, add a file in the merge
      directory called ejb-security-roles.xml that contains them.
    -->

  <!-- method permissions -->
    <!--
To specify additional method-permission elements, add a file in the merge
      directory called ejb-method-permissions.ent that contains them.
    -->

  <!-- transactions -->
    <!--
To specify additional container-transaction elements, add a file in the merge
      directory called ejb-container-transactions.ent that contains them.
    -->

  <!-- finder transactions -->

  <!-- message destinations -->
    <!--
To specify additional message-destination elements, add a file in the merge
      directory called ejb-message-destinations.ent that contains them.
    -->

  <!-- exclude list -->
    <!--
      To specify an exclude-list element, add a file in the merge directory
      called ejb-exclude-list.xml that contains it.
    -->
  </assembly-descriptor>

</ejb-jar>


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd";>

<jboss>

  <security-domain>java:/jaas/samples</security-domain>

  <enterprise-beans>

    <!--
      To add beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called jboss-beans.xml that contains the <session></session>, <entity></entity> and <message-driven></message-driven>
      markup for those beans.
    -->

   <!--
     write a merge file jboss-webservices.ent for webservice-description
   -->

  </enterprise-beans>

  <resource-managers>
  </resource-managers>

 <!--
   | for container settings, you can merge in jboss-container.xml
| this can contain <invoker-proxy-bindings/> and <container-configurations/>
 -->

</jboss>

_________________________________________________________________
Scan and help eliminate destructive viruses from your inbound and outbound e-mail and attachments. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSNĀ® Premium right now and get the first two months FREE*.



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
xdoclet-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to