XDoclet not generating proper deployment descriptors

Discussion in 'Java' started by SmokingGun, Feb 9, 2004.

  1. SmokingGun

    SmokingGun Guest

    How come my jndi-name an display-name values posted in *Bean.java is
    not passed unto the ejb-jar.xml file when running xdoclet.

    HelloBean.java

    /*
    * Created on Feb 9, 2004
    */
    package com.caritos.sample.ejb;

    import javax.ejb.*;

    /**
    * @ejb:bean type="Stateless"
    * name="com.caritos.sample.ejb.HelloBean"
    * jndi-name="HelloBean"
    * display-name="EJB HelloBean"
    *
    */
    public class HelloBean implements SessionBean {
    public void ejbCreate() {
    System.out.println("ejbCreate()");
    }

    public void ejbRemove() {
    System.out.println("ejbRemove()");
    }

    public void ejbActivate() {
    System.out.println("ejbActivate()");
    }

    public void ejbPassivate() {
    System.out.println("ejbPassivate()");
    }

    public void setSessionContext(SessionContext ctx) {
    System.out.println("setSessionContext()");
    }

    public String hello() {
    System.out.println("hello()");
    return "Hello, World!";
    }
    }


    build.xml

    <?xml version="1.0"?>

    <project name="EJB Xbean" default="ejb-jar" basedir=".">

    <!-- Init -->
    <target name="init">

    <property name="lib.dir" value="lib" />

    <property name="src.dir" value="src" />
    <property name="generated.src.dir" value="gen-src" />

    <property name="java.dir"
    value="D:/eclipse/workspace/SampleEJB/src/com/caritos/sample/ejb" />
    <property name="generated.java.dir"
    value="${generated.src.dir}/java" />

    <property name="config.dir" value="config" />
    <property name="build.dir" value="build" />
    <property name="dist.dir" value="dist" />

    <property name="build.compiler" value="modern" />
    <property name="name" value="receiver-xbean" />

    <!-- Set up local paths -->
    <path id="ejb.classpath">
    <fileset dir="D:/sandbox/xdoclet-1.2/">
    <include name="*.jar"/>
    </fileset>
    <fileset dir="D:/sandbox/jboss-3.2.3/server/default/lib/">
    <include name="*.jar"/>
    </fileset>
    <pathelement location="D:/eclipse/workspace/ampleEJB/ThirdParty/xdoclet-1.2.jar"/>
    <pathelement location="D:/eclipse/workspace/ampleEJB/ThirdParty/log4j-1.2.8.jar"/>
    <pathelement location="D:/eclipse/workspace/ampleEJB/ThirdParty/ant.jar"/>
    </path>
    </target>


    <!-- Prepare -->
    <target name="prepare" depends="init">

    <mkdir dir="${build.dir}" />

    <mkdir dir="${build.dir}/ejb" />
    <mkdir dir="${build.dir}/ejb/META-INF" />

    <mkdir dir="${build.dir}/j2ee" />
    <mkdir dir="${dist.dir}" />

    <mkdir dir="${generated.src.dir}" />
    <mkdir dir="${generated.java.dir}" />

    </target>

    <!-- Run EJBDoclet -->
    <target name="ejbdoclet" depends="prepare">

    <taskdef name="ejbdoclet"
    classname="xdoclet.modules.ejb.EjbDocletTask"
    classpathref="ejb.classpath"/>

    <ejbdoclet
    destdir="${generated.java.dir}" ejbspec="1.1">

    <fileset dir="${java.dir}">
    <include name="HelloBean.java" />
    </fileset>

    <remoteinterface/>
    <homeinterface/>
    <deploymentdescriptor destdir="${build.dir}/ejb/META-INF"/>

    <jboss version="2.4" xmlencoding="UTF-8"
    destdir="${build.dir}/ejb/META-INF"/>
    <webSphere destdir="${build.dir}/ejb/META-INF" />
    </ejbdoclet>

    </target>

    <!-- Compile -->
    <target name="compile" depends="ejbdoclet">

    <!-- Compile EJBs -->
    <javac srcdir="${java.dir};${generated.java.dir}"
    destdir="${build.dir}/ejb"
    includes="examples/*.java">
    </javac>

    </target>


    <!-- Create EJB-JAR file -->
    <target name="ejb-jar" depends="compile">

    <jar jarfile="${build.dir}/j2ee/${name}-ejb.jar"
    basedir="${build.dir}/ejb" />

    </target>


    <!-- Clean everything -->
    <target name="clean" depends="init">

    <delete dir="${build.dir}" />
    <delete dir="${dist.dir}" />
    <delete dir="${generated.src.dir}" />

    </target>


    </project>

    Generated ejb-jar.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise
    JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.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.
    -->

    </enterprise-beans>

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

    <!-- transactions -->

    <!-- finder transactions -->
    </assembly-descriptor>

    </ejb-jar>
     
    SmokingGun, Feb 9, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Benny Ng
    Replies:
    0
    Views:
    4,421
    Benny Ng
    Oct 3, 2005
  2. Sigmund Lundgren
    Replies:
    0
    Views:
    371
    Sigmund Lundgren
    May 26, 2004
  3. D. Alvarado

    Generating the proper url

    D. Alvarado, Oct 25, 2004, in forum: Java
    Replies:
    0
    Views:
    290
    D. Alvarado
    Oct 25, 2004
  4. Greg
    Replies:
    0
    Views:
    632
  5. Kees de Winter

    Generating proper classes with XSD.exe

    Kees de Winter, Feb 2, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    554
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 2, 2007
Loading...

Share This Page