• Post Reply Bookmark Topic Watch Topic
  • New Topic

question about xdoclet in eclipse  RSS feed

 
Yonghang Cai
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am code codeing EJB by eclipse2.1+ant+xdoclet,and build ejb-jar.xml file.
My source file location in src\example,compiled filr location in classes folder.
My build.xml look like this:
<project name="BuildDes" default="builddes" basedir=".">
<description>
simple example build file
</description>
<property name="src.dir" location="src/examples"/>
<property name="metainf.dir" location="META-INF"/>
<property name="lib.dir" location="lib"/>

<target name="init">
<mkdir dir="${metainf.dir}"/>
<path id="project.class.path">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<taskdef name="ejbdoclet"
classname="xdoclet.modules.ejb.EjbDocletTask"
classpathref="project.class.path"/>
</target>

<target name="builddes" description="generat the distribution" depends="init">
<tstamp>
<format property="TODAY" pattern="d-MM-yy"/>
</tstamp>

<ejbdoclet
destdir="${metainf.dir}"
excludedtags="@version,@author"
ejbspec="2.0">

<fileset dir="${src.dir}">
<include name="**/*Remote.java"/>
</fileset>

<remoteinterface pattern="{0}Remote"/>

<localinterface pattern="{0}"/>
<homeinterface />

<localhomeinterface/>
<deploymentdescriptor destdir="${metainf.dir}"
description="CMP with Ant"
displayname="CMP" />

</ejbdoclet>
</target>

<target name="clean" description="clean up"/>
</project>
run successfully:
buildfile: D:\eclipse\workspace\MyEJB\build.xml
init:
[mkdir] Created dir: D:\eclipse\workspace\MyEJB\META-INF
init:
builddes:
[ejbdoclet] Running <remoteinterface/>
[ejbdoclet] Running <localinterface/>
[ejbdoclet] Running <homeinterface/>
[ejbdoclet] Running <localhomeinterface/>
[ejbdoclet] Running <deploymentdescriptor/>
[ejbdoclet] Generating EJB deployment descriptor (ejb-jar.xml).
clean:
BUILD SUCCESSFUL
Total time: 5 seconds
but the ejb-jar.xml file only contain some comment:
<?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[CMP with Ant]]></description>
<display-name>CMP</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 -->
<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>
My AccountRemote.java 's comment like this:
/**
* @ejb.bean
* name="AccountBean"
* type="BMP"
* jndi-name="AccountHome"
* local-jndi-name="AccountLocalHome"
* reentrant="false"
*
* @ejb.pk
* class="examples.AccountPK"
*
* @ejb.interface
* remote-class="examples.Account"
* local-class="examples.AccountLocal"
*
* @ejb.home
* remote-class="examples.AccountHome"
* local-class="examples.AccountLocalHome"
*
* @ejb.resource-ref
* res-ref-name="jdbc/ejbPool"
* res-type="javax.sql.DataSource"
* res-auth="Container"
*
* @ejb.env-entry name="DataSourceName"
* value="java:/mysql"
*/

My question: Why i can not get right content in ejb-jar.xml?
Thank u ~~
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!