Below please see the problem in detail with xdoclet from CVS (just
re-pulled it down). This problem does not exist in xdoclet 1.1.2.
----------------------------
WHAT JBOSS COMPLAINED ABOUT:
2002-05-29 15:19:57,870 ERROR [org.jboss.ejb.EjbModule] Initialization
failed
org.jboss.deployment.DeploymentException: Role: Keyword-Has-Group with
multiplicity many using foreign-key mapping is not allowed to have
key-fields
at
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshipRoleMetaData.loadKeyFields(JDBCRelationshipRoleMetaData.java:357)
--------------------------------
WHAT XDOCLET CVS CREATED FOR ME:
(backwards!!!)
<ejb-relation>
<ejb-relation-name>Group-Keyword</ejb-relation-name>
<foreign-key-mapping/>
<ejb-relationship-role>
<ejb-relationship-role-name>Keyword-Has-Group</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>key</field-name>
<column-name>GROUP_KEY</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>Group-Has-Keywords</ejb-relationship-role-name>
</ejb-relationship-role>
</ejb-relation>
---------------------------------------
WHAT I WANTED XDOCLET TO CREATE FOR ME:
(xdoclet 1.1.2 did this correctly)
<ejb-relation>
<ejb-relation-name>Group-Keyword</ejb-relation-name>
<foreign-key-mapping/>
<ejb-relationship-role>
<ejb-relationship-role-name>Group-Has-Keywords</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>key</field-name>
<column-name>GROUP_KEY</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>Keyword-Has-Group</ejb-relationship-role-name>
<key-fields/>
</ejb-relationship-role>
</ejb-relation>
------------------------------
THE JAVA FILES THAT DEFINE IT:
From GroupBean.java:
/**
* @ejb:interface-method
* @ejb:relation
* name="Group-Keyword"
* role-name="Group-Has-Keywords"
* @ejb:value-object
* match="*"
* aggregate="java.util.Set"
* aggregate-name="KeywordValues"
*/
public abstract Set getKeywords();
From KeywordBean.java:
/**
* @ejb:interface-method
* @ejb:relation
* name="Group-Keyword"
* role-name="Keyword-Has-Group"
* @ejb:value-object
* match="*"
* aggregate="GroupValue"
* aggregate-name="GroupValue"
* @jboss:relation
* related-pk-field="key"
* fk-column="GROUP_KEY"
*/
public abstract GroupLocal getGroup();
Thanks,
David
--
David Ward wrote:
> I have the same problem now...
>
> I had been running xdoclet 1.1.2 successfully with jboss3rc3 cmr with no
> problems. I just pulled down the newest xdoclet from cvs this morning
> and it broke my jbosscmp-jdbc.xml cmr's (the keyfields all of a sudden
> appeared on the other side of their relationships!).
>
> David
>
> --
>
> Grant Marblestone wrote:
>
>> I tried to deploy my jar file and i get this error.. i am not sure if
>> its
>> xdoclet or jboss..... so i post here first...
>> org.jboss.deployment.DeploymentException: error in create of
>> EjbModule:
>> file:/C:/jboss-3.0.0RC3/server/default/deploy/middlegen-demo-ejb.jar;
>> nested throwable :(org.jboss.deployment.DeploymentException: Role:
>> qcrpt_init_phase-has-cont_qc_rpt with multiplicity many using
>> foreign-key
>> mapping is not allowed to have key-fields)
>>
>>
>>
>>> Which xdoclet version? Also, please post relevant code sections, ie,
>>> tags where you define this relation.
>>
>>
>>
>> answer:
>>
>> 1.1.2
>> <!--CODE-->
>> public abstract java.math.BigDecimal getReportNoFk();
>>
>> /**
>> * Sets the reportNoFk
>> *
>> * @param reportNoFk the new reportNoFk
>> */
>> public abstract void setReportNoFk(java.math.BigDecimal reportNoFk);
>>
>> /**
>> * Returns a collection of local ContQcRpt
>> *
>> * @return a collection of local ContQcRpt
>> *
>> * @ejb:interface-method view-type="local"
>> *
>> * @ejb:relation
>> * name="cont_qc_rpt-qcrpt_init_phase"
>> * role-name="qcrpt_init_phase-has-cont_qc_rpt"
>> *
>> *
>> * @weblogic:target-column-map
>> * foreign-key-column="REPORT_NO_FK"
>> * key-column="REPORT_NO"
>> *
>> */
>>
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user