Hi, I've 2 beans one-one relationships and this piece of code InitialContext ctx = new InitialContext(); SDocuments myBean = getHome().create(); Collection col = myBean.getAllDocumentByCategoryId(11); Iterator iter = col.iterator(); while (iter.hasNext()) { EDocuments element = ((EDocuments) iter.next()); System.out.println("Abstract:" + element.getShortabstract()); EDocMetaData metaData = element.getDocMetaData(); System.out.println("Rawtext:" + metaData.getRawtext()); } } catch (NamingException e) { e.printStackTrace(); }
in the bold line this error appear: java.lang.ClassCastException at com.Entrieva.Skyline.EntityBeans.EDocumentsCMP$Proxy.getDocMetaData() the ejb-jar relationships is : <!-- Relationships --> <ejb-relation > <ejb-relation-name>EDocuments-EDocMetaData</ejb-relation-name> <ejb-relationship-role > <ejb-relationship-role-name>EDocuments-has-one-EDocMetadata</ejb-relationship-role-name> One <relationship-role-source > <ejb-name>EDocuments</ejb-name> </relationship-role-source> <cmr-field > <cmr-field-name>docMetaData</cmr-field-name> </cmr-field> </ejb-relationship-role> <ejb-relationship-role > <ejb-relationship-role-name>EDocMetadata-has-one-EDocuments</ejb-relationship-role-name> One <relationship-role-source > <ejb-name>EDocMetaData</ejb-name> </relationship-role-source> <cmr-field > <cmr-field-name>documents</cmr-field-name> </cmr-field> </ejb-relationship-role> </ejb-relation> View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3835237#3835237 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3835237 ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user