Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > XDoclet not generating proper deployment descriptors

Reply
Thread Tools

XDoclet not generating proper deployment descriptors

 
 
SmokingGun
Guest
Posts: n/a
 
      02-09-2004
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>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating proper classes with XSD.exe Kees de Winter ASP .Net 2 02-02-2007 08:26 PM
Maven2 and XDoclet : org.xdoclet.plugin.web.TaglibPlugin don't generate TLD inherited attributes Greg Java 0 05-17-2006 07:37 AM
Enterprise Library deployment problem. Why needs to InstallUtil DLLs to the deployment server? If not, Registry Error whould shown. Benny Ng ASP .Net 0 10-03-2005 05:40 AM
Generating the proper url D. Alvarado Java 0 10-25-2004 07:53 PM
XDoclet and generating Dependent Value Classes Sigmund Lundgren Java 0 05-26-2004 07:58 PM



Advertisments