Patches item #515019, was opened at 2002-02-08 22:11
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=402706&aid=515019&group_id=31602
Category: ejbdoclet
Group: None
>Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Tim Taylor (ttaylor)
Assigned to: Vincent Harcq (vharcq)
>Summary: Incorrect <ejb-ref> elements generated
Initial Comment:
The following EJBDoclet tags generated incorrect <ejb-ref> ... </ejb-ref> elements in
the
deployment descriptor:
/**
* @ejb:bean type="BMP" name="MyBMPEntity" display-name="My Bean"
* transaction-type="Container" reentrant="False"
* jndi-name="ejb/my/Entity" view-type="remote"
* @ejb:home remote-pattern="MyEntityHome"
* @ejb:interface remote-pattern="MyEntity"
* @ejb:pk class="java.lang.String"
* @ejb:ejb-ref ejb-name="MyOtherEntity"
* view-type="remote"
* ref-name="ejb/my/OtherEntity"
* @ejb:ejb-external-ref ref-name="ejb/catalog/Catalog"
* type="Session"
* home="my.company.catalog.interfaces.CatalogHome"
* remote="my.company.catalog.interfaces.Catalog"
*/
After building the deployment descriptor with these ant tasks:
<xdoclet sourcepath="${catalog.src}"
destdir="${catalog.gen-src}"
classpath="${xdoclet.task.classpath}"
ejbspec="1.1"
excludedtags="@version,@author">
<fileset dir="${catalog.src}">
<include name="**/*EJB.java"/>
</fileset>
<packageSubstitution packages="ejb" substituteWith="interfaces"/>
<remoteinterface/>
<homeinterface/>
<deploymentdescriptor xmlencoding="UTF-8"
destdir="${catalog.build.meta}"/>
</xdoclet>
The deployment descriptor (just the relevant entity element) looks like this:
<entity id="MyBMPEntity">
<description><![CDATA[My description]]></description>
<display-name>My Bean</display-name>
<ejb-name>MyBMPEntity</ejb-name>
<home>my.company.interfaces.MyEntityHome</home>
<remote>my.company.interfaces.MyEntity</remote>
<ejb-class>my.company.ejb.MyEntityEJB</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<ejb-ref>
<ejb-ref-name>ejb/catalog/Catalog</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>my.company.catalog.interfaces.CatalogHome</home>
<remote>my.company.catalog.interfaces.Catalog</remote>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>ejb/my/OtherEntity</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>my.company.interfaces.MyEntityHome</home>
<remote>my.company.interfaces.MyEntity</remote>
<ejb-link>MyOtherEntity</ejb-link>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>ejb/my/OtherEntity</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>my.company.interfaces.OtherEntityHome</home>
<remote>my.company.interfaces.OtherEntity</remote>
<ejb-link>MyOtherEntity</ejb-link>
</ejb-ref>
</entity>
Notice that there are TWO <ejb-ref> elements that were created for the ONE tag:
@ejb:ejb-ref ejb-name="MyOtherEntity" view-type="remote" ref-name="ejb/my/OtherEntity"
I believe that this only happens if you have at least one @ejb:ejb-external-ref. If
this is the case,
than you will get two <ejb-ref> elements generated for every @ejb:ejb-ref that the
class also has.
One will be correct, and one will be incorrect.
The attached patch fixes this problem and also corrects a typo which results in a
comment in the
generated deployment descriptor that says to merge additional entity beans into the
deployment
descriptor create a file in the merge directory named session-beans.xml. Should be
entity-beans.xml
----------------------------------------------------------------------
Comment By: Vincent Harcq (vharcq)
Date: 2002-02-08 23:26
Message:
Logged In: YES
user_id=125677
Thanks!
Fixed
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=402706&aid=515019&group_id=31602
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel