From: Donald B. <ba...@we...> - 2001-03-23 18:59:29
|
Hi guys. I'm quite new to jboss and the world of EJB, but i think i've got a fairly good handle on things - got jboss-2.1 installed and running, developed a few little entity beans, convinced JAWS to use postgresql as a backend, etc. hooray, jboss is good stuff. i'm having trouble making it do dependencies between by entity beans though. i started with a simple set of 'news site' beans - Article, Author, Section. each Article must have one Author and one Section. my ArticleBean class has these fields: public int id; public String title; public String content; public Section section; public Author author; if my deployment descriptor ignores the bean references, all is hunky dory: <entity> <description> A news article </description> <ejb-name>Article</ejb-name> <home>com.webslingerZ.news.beans.ArticleHome</home> <remote>com.webslingerZ.news.beans.Article</remote> <ejb-class>com.webslingerZ.news.beans.ArticleBean</ejb-class> <persistence-type>Container</persistence-type> <prim-key-class>com.webslingerZ.news.beans.ArticlePK</prim-key-class> <reentrant>False</reentrant> <cmp-field><field-name>id</field-name></cmp-field> <cmp-field><field-name>title</field-name></cmp-field> <cmp-field><field-name>content</field-name></cmp-field> </entity> but if I add the Author and Section to the cmp-fields: <cmp-field><field-name>Author</field-name></cmp-field> <cmp-field><field-name>Section</field-name></cmp-field> i get exciting stack dumps in the jboss stdout: [Verifier] Verifying file:/home/balld/src/jboss/dist/tmp/deploy/Default/news.jar/ejb1001.jar [Container factory] Deploying Article [Container factory] Deploying Section [Container factory] Deploying Author [Container factory] org.jboss.ejb.DeploymentException: cmp-field Section is not a field in ejb class com.webslingerZ.news.beans.ArticleBean [Container factory] at org.jboss.ejb.plugins.jaws.metadata.CMPFieldMetaData.verifyNestedField(CMPFieldMetaData.java:206) i was given to understand that ejb-1.1 allowed bean references to be container-managed fields. does jboss not support this, or am i doing this the wrong way? is there a different preferred way to do this, e.g. storing a PK or a Handle to the dependent entity beans? - donald |