|
Got some weird things out of the ejbdoclet tasks today.
I have an entity bean for which we are generating a session fa�ade for using of course the @ejb.facade
In the past I have always used the view-type=”remote” but we only wanted this particular fa�ade to be local so I used that.
The problem I have is that when the entityfacade is generated it throws a remoteException in a create method and then of course when we generate the local interfaces on that fa�ade the locals now throw RemoteException and it wont deploy (Jboss) because they aren’t allowed to throw remoteException.
I have dug through the docs to see if there is something I am missing, but I can’t find anything.
Here is a simple example (obviously not my real one)
package org.homedns.afogleson.ejb;
import javax.ejb.EntityBean;
/** �* �* <!-- begin-xdoclet-definition --> �* @ejb.bean name="SimpleEntity" �*��������� jndi-name="simple" �*��������� type="CMP" �*� primkey-field="id" �*� schema="simple" �*� cmp-version="2.x" �*� data-source="java:/ejbDS" �* �*� @ejb.persistence �*�� table-name="simple" �* �* @ejb.finder �*��� query="SELECT OBJECT(a) FROM simple as a"� �*��� signature="java.util.Collection findAll()"� �* �* @ejb.finder �*��� query="SELECT OBJECT(a) FROM simple as a where a.name = ?1" �*��� signature="java.util.Collection findByName(java.lang.String name)" �* �* @ejb.data-object �* �* @ejb.facade �*�� view-type="local" �* �* @ejb.pk class="java.lang.Integer" �* <!-- end-xdoclet-definition --> �* @generated �**/ public abstract class SimpleEntityBean implements EntityBean {
� /** �� * �� * <!-- begin-user-doc --> �� * The� ejbCreate method. �� * <!-- end-user-doc --> �� * �� * <!-- begin-xdoclet-definition --> �� * @ejb.create-method �� * <!-- end-xdoclet-definition --> �� * @generated �� */ � public java.lang.Integer ejbCreate() throws javax.ejb.CreateException { ��� // EJB 2.0 spec says return null for CMP ejbCreate methods. ��� // TODO: YOU MUST INITIALIZE THE FIELDS FOR THE BEAN HERE. ��� // setMyField("Something"); ��� // begin-user-code ��� return null; ��� // end-user-code � }
� /** �� * <!-- begin-user-doc --> �� * The container invokes this method immediately after it calls ejbCreate. �� * <!-- end-user-doc --> �� * �� * @generated �� */ � public void ejbPostCreate() throws javax.ejb.CreateException { ��� // begin-user-code ��� // end-user-code � }
� /** �� * �� * �� * <!-- begin-user-doc --> �� * CMP Field id �� * �� * Returns the id �� * @return the id �� * �� * <!-- end-user-doc --> �� * �� * <!-- begin-xdoclet-definition --> �� * �� * @ejb.persistent-field �� * @ejb.persistence �� *��� column-name="id" �� *���� jdbc-type="VARCHAR" �� *���� sql-type="INTEGER" �� *���� read-> �� * @ejb.pk-field �� * �� * @ejb.interface-method �� * �� * <!-- end-xdoclet-definition --> �� * @generated �� */ � public abstract java.lang.Integer getId();
� /** �� * <!-- begin-user-doc --> �� * Sets the id �� * �� * @param java.lang.Integer the new id value �� * <!-- end-user-doc --> �� * �� * <!-- begin-xdoclet-definition --> �� * @ejb.interface-method �� * <!-- end-xdoclet-definition --> �� * @generated �� */ � public abstract void setId(java.lang.Integer id);
� /** �� * �� * �� * <!-- begin-user-doc --> �� * CMP Field name �� * �� * Returns the name �� * @return the name �� * �� * <!-- end-user-doc --> �� * �� * <!-- begin-xdoclet-definition --> �� * �� * @ejb.persistent-field �� * @ejb.persistence �� *��� column-name="name" �� *���� jdbc-type="VARCHAR" �� *���� sql-type="VARCHAR" �� *���� read-> �� *� �� * �� * @ejb.interface-method �� * �� * <!-- end-xdoclet-definition --> �� * @generated �� */ � public abstract java.lang.String getName();
� /** �� * <!-- begin-user-doc --> �� * Sets the name �� * �� * @param java.lang.String the new name value �� * <!-- end-user-doc --> �� * �� * <!-- begin-xdoclet-definition --> �� * @ejb.interface-method �� * <!-- end-xdoclet-definition --> �� * @generated �� */ � public abstract void setName(java.lang.String name); � � /** �� * �� * �� * @ejb.interface-method �� * �� * @return �� */ � public abstract SimpleEntityData getData(); }
and here is my ejbdoclet task for running on the sessionFacade created.
��� <ejbdoclet destdir="${ejbsrc.dir}" �������������� mergedir="${ejb.dd.dir}" �������������� excludedtags="@version,@author,@todo" �������������� addedtags="@generated" �������������� ejbspec="2.0" �������������� force="${xdoclet.force}" �������������� verbose="true" > ����� <!-- ������� This is where you declare what classes to ������� parse. ������ --> ��� ��<fileset dir="${j2src.dir}"/> ����� <fileset dir="${ejbsrc.dir}"> ������� <include name="**/*FacadeEJB.*"/> ����� </fileset> ����� <utilobject cacheHomes="true" includeGUID="true" /> ����� <entityfacade/> ����� <dataobject/> ����� <valueobject /> ����� <remotefacade/> ����� <localinterface/> ����� <localhomeinterface/> ����� <homeinterface/> ����� <remoteinterface/> ����� <entitypk/> ����� <entitycmp/> ����� <session/> ����� <deploymentdescriptor destdir="${ejb.dd.dir}" ��������� validatexml="false" ��������� mergedir="${ejb.dd.dir}" /> ����� <jboss �������� version="3.0" �������� unauthenticatedPrincipal="nobody" �������� xmlencoding="UTF-8" �������� destdir="${ejb.dd.dir}" �������� validatexml="false" �������� datasource="java:/ejbDS" ����� ���datasourcemapping="mySQL" �������� preferredrelationmapping="foreign-key" /> ��� </ejbdoclet>
|
- [Xdoclet-user] is there a bug? Fogleson, Allen
- [Xdoclet-user] is there a bug? Fogleson, Allen
