-
1. Re: xdoclet, JBoss-30-RC1, and *.xml generation
penningw Apr 20, 2002 6:10 AM (in response to tonala)I'm using xdoclet.jar 1.1.2 and jboss-3.0.0RC1_tomcat-4.0.3 to generate nearly correct deployment files (ejb-jar, jboss, jaws, and jbosscmp-jdbc). I hope the code snippets help you get a little further. (The thought of this is ugly, but you could use differet xdoclet distributions to perform different parts of your build.)
I get the following ERROR on deployment (
I am not sure whether I must add the data jbosscmp-jdbc-load-CustomerBean.xml merge file the xdoclet output suggests. It appears I do). If a JBoss pro can help, I would be happy to post a working xdoclet example ... that has all the weblogic crap stripped out! ;)
17:04:11,479 ERROR [EntityContainer] Exception in service lifecyle operation: create
org.jboss.deployment.DeploymentException: CMP field not found : fieldName=name
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.(JDBCEntityMetaData.java:465)
I'm using a modified xdoclet sample ant build.xml from cvs that has the following in its ejbdoclet task:
My bean files generally include a header like:
/**
* @ejb:bean
* type="CMP"
* name="bank/Customer"
* jndi-name="ejb/bank/Customer"
* local-jndi-name="ejb/bank/Customer"
* view-type="both"
* cmp-version="2.x"
* @ejb:ejb-ref ejb-name="bank/Customer"
* @ejb:value-object name="Customer" match="*" instantiation="eager"
* @ejb:security-role-ref role-name="admin" role-link="Administrator"
* @ejb:permission role-name="Teller"
* @ejb:transaction type="Required"
* @ejb:finder signature="Collection findAll()" role-name="Teller" transaction-type="NotSupported"
* @ejb:finder signature="Collection findAlsoInSuper()" transaction-type="NotSupported"
* @jboss:ejb-ref-jndi ref-name="bank/Customer" jndi-name="ejb/bank/Customer"
* @jboss:table-name "customer"
* @jboss:create-table "true"
* @jboss:remove-table "true"
* @jboss:tuned-updates "true"
* @jboss:read-only "false"
*
*/
This produces the following in the jbosscmp-jdbc.xml:
<ejb-name>bank/Customer</ejb-name>
<create-table>true</create-table>
<remove-table>true</remove-table>
<read-only>false</read-only>
<table-name>customer</table-name>
<cmp-field>
<field-name>address</field-name>
<column-name>address</column-name>
</cmp-field>
<cmp-field>
<field-name>array</field-name>
<column-name>array</column-name>
</cmp-field>
<cmp-field>
<field-name>credit</field-name>
<column-name>credit</column-name>
</cmp-field>
<cmp-field>
<field-name>id</field-name>
<column-name>customerid</column-name>
</cmp-field>
<cmp-field>
<field-name>image</field-name>
<column-name>image</column-name>
</cmp-field>
<cmp-field>
<field-name>person</field-name>
<column-name>person</column-name>
</cmp-field>
<cmp-field>
<field-name>tax</field-name>
<column-name>tax</column-name>
</cmp-field>
<!--
To define load groups for this entity, write a file named
jbosscmp-jdbc-load-CustomerBean.xml and put it in
your mergedir. Write it according to the following DTD slice:
<!ELEMENT load-groups (load-group+)>
<!ELEMENT load-group (load-group-name, description?, field-name+)>
<!ELEMENT load-group-name (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT field-name (#PCDATA)>
<!ELEMENT eager-load-group (#PCDATA)>
<!ELEMENT lazy-load-groups (load-group-name+)>
--> -
2. Re: xdoclet, JBoss-30-RC1, and *.xml generation
penningw Apr 21, 2002 3:00 AM (in response to tonala)You'll want to ignore my two cents in the last post except for the point that xdoclet 1.1.2 seems to generate most of the *.xml. My xdoclet declarations have changed a bit and 'am trying to address related valueobject issues.