From: Clarance H. <cla...@me...> - 2005-08-19 22:11:44
|
Just had another look at this problem and I think the problem is not in=20 your mapping but in XDoclet's handling of m:n relationships in value=20 objects. When you try to get the Organisation value object you get all=20 associated periods and when you get all periods, xdoclet generated code=20 tries to get all the Organisations. The exception that you are seeing=20 is a result of this circular dependency. You could fix it by excluding one of the collections from your value=20 object or changing the XDoclet generated implementation code to check=20 for this circular dependency. Hope this helps Cheers C. Vang Nguyen wrote: >Hi, > >Does any one have a working mapping of a bidirectional n:m relationship = that they could share? I've been trying with various settings with no lu= ck. My current xdoclet declarations for the relationship between Organsi= ation and Period entities are below, but I'm getting the exception listed= below the code.=20 > > > /** > * @ejb.relation > * name=3D"Organisation-Period" > * role-name=3D"periods-have-organisations" > * @weblogic.column-map > * key-column=3D"C_ID" > * foreign-key-column=3D"C_PERIOD_ID" > * @weblogic.relation > * join-table-name=3D"MPRS_ORGANISATION_PERIOD_JOIN" > * @ejb.interface-method > * view-type=3D"local" > * @ejb.value-object > * aggregate=3D"au.gov.qld.des.mprs.dto.OrganisationTransferObject= " > * aggregate-name=3D"Organisation" > * members=3D"au.gov.qld.des.mprs.ejb.OrganisationLocal" > * members-name=3D"OrganisationLocal" > * relation=3D"external" > * type=3D"java.util.Collection" > */ > public abstract Collection getOrganisations(); > > > /** > * @ejb.relation > * name=3D"Organisation-Period" > * role-name=3D"organisations-have-periods" > * @weblogic.column-map > * key-column=3D"C_ID" > * foreign-key-column=3D"C_ORGANISATION_ID" > * @weblogic.relation > * join-table-name=3D"MPRS_ORGANISATION_PERIOD_JOIN" > * @ejb.interface-method > * view-type=3D"local" > * @ejb.value-object > * aggregate=3D"au.gov.qld.des.mprs.dto.PeriodTransferObject" > * aggregate-name=3D"Period" > * members=3D"au.gov.qld.des.mprs.ejb.PeriodLocal" > * members-name=3D"PeriodLocal" > * relation=3D"external" > * type=3D"java.util.Collection" > * > */ > public abstract java.util.Collection getPeriods(); > >Exception occurred: au.gov.qld.des.mprs.exception.ServiceUnavailableExce= ption: Exception occured getting Financial Years Caused By: au.gov.qld.de= s.mprs.exception.ServiceUnavailableException: Error occurred Caused By: a= u.gov.qld.des.mprs.exception.ServiceUnavailableException: Exception conve= rting Caused By: javax.ejb.TransactionRolledbackLocalException: EJB Excep= tion: ; nested exception is: javax.ejb.EJBException: nested exception is:= javax.ejb.TransactionRolledbackLocalException: EJB Exception: ; nested e= xception is: javax.ejb.EJBException: nested exception is: javax.ejb.Trans= actionRolledbackLocalException: [EJB:010180]Illegal Reentrant call to 'Pe= riod(Application: mprs-ear-1.0, EJBComponent: mprs-ejb-1.0.jar)' with pri= mary key: '1'.: weblogic.ejb20.InternalException: [EJB:010180]Illegal Ree= ntrant call to 'Period(Application: mprs-ear-1.0, EJBComponent: mprs-ejb-= 1.0.jar)' with primary key: '1'. at weblogic.ejb20.manager.BaseEntityMana= ger.checkForReentrant(Ljavax.ejb.EntityBean;Ljava.lang.Object;)V(BaseEnti= tyManager.java:1468) at weblogic.ejb20.manager.DBManager.preInvoke(Lweblo= gic.ejb20.internal.InvocationWrapper;)Ljavax.ejb.EnterpriseBean;(DBManage= r.java:251) at weblogic.ejb20.internal.BaseEJBLocalObject.preInvoke(Lwebl= ogic.ejb20.internal.InvocationWrapper;)Lweblogic.ejb20.internal.Invocatio= nWrapper;(BaseEJBLocalObject.java:228) at weblogic.ejb20.internal.EntityE= JBLocalObject.preInvoke(Lweblogic.ejb20.internal.MethodDescriptor;Lweblog= ic.security.service.ContextHandler;)Lweblogic.ejb20.internal.InvocationWr= apper;(EntityEJBLocalObject.java:72) at au.gov.qld.des.mprs.ejb.Period_a3= 1n8k_ELOImpl.getPeriodTransferObject()Lau.gov.qld.des.mprs.dto.PeriodTran= sferObject;(Period_a31n8k_ELOImpl.java:514) at au.gov.qld.des.mprs.ejb.Or= ganisationCMP.getOrganisationTransferObject()Lau.gov.qld.des.mprs.dto.Org= anisationTransferObject;(OrganisationCMP.java:102) at au.gov.qld.des.mprs= =2Eejb.Organisation_smb3qq_ELOImpl.getOrganisationTransferObject()Lau.gov= =2Eqld.des.mprs.dto.OrganisationTransferObject;(Organisation_smb3qq_ELOIm= pl.java:585) at au.gov.qld.des.mprs.ejb.PeriodCMP.getPeriodTransferObject= ()Lau.gov.qld.des.mprs.dto.PeriodTransferObject;(PeriodCMP.java:106) at a= u.gov.qld.des.mprs.ejb.Period_a31n8k_ELOImpl.getPeriodTransferObject()Lau= =2Egov.qld.des.mprs.dto.PeriodTransferObject;(Period_a31n8k_ELOImpl.java:= 531) at au.gov.qld.des.mprs.ejb.MPRSFacadeBean.convertPeriodLocalsToDTOs(= Ljava.util.Collection;)Ljava.util.Collection;(MPRSFacadeBean.java:281) at= au.gov.qld.des.mprs.ejb.MPRSFacadeBean.findFinancialYears()Ljava.util.Co= llection;(MPRSFacadeBean.java:222) at au.gov.qld.des.mprs.ejb.MPRSFacade_= vhf35m_EOImpl.findFinancialYears()Ljava.util.Collection;(MPRSFacade_vhf35= m_EOImpl.java:154) at au.gov.qld.des.mprs.ejb.MPRSFacade_vhf35m_EOImpl_CB= V.findFinancialYears()Ljava.util.Collection;(Unknown Source) at au.gov.ql= d.des.mprs.business.MPRSBusinessDelegate.findFinancialYears()Ljava.util.C= ollection;(MPRSBusinessDelegate.java:83) at au.gov.qld.des.mprs.Financial= YearAction.view(Lorg.apache.struts.action.ActionMapping;Lorg.apache.strut= s.action.ActionForm;Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet= =2Ehttp.HttpServletResponse;)Lorg.apache.struts.action.ActionForward;(Fin= ancialYearAction.java:43) at jrockit.reflect.NativeMethodInvoker.invoke0(= Ljava.lang.Object;ILjava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Objec= t;(Unknown Source) at jrockit.reflect.NativeMethodInvoker.invoke(Ljava.la= ng.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source) at jrock= it.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lan= g.Object;)Ljava.lang.Object;(Unknown Source) at java.lang.reflect.Method.= invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown = Source) at org.apache.struts.actions.DispatchAction.dispatchMethod(Lorg.a= pache.struts.action.ActionMapping;Lorg.apache.struts.action.ActionForm;Lj= avax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletRespo= nse;Ljava.lang.String;)Lorg.apache.struts.action.ActionForward;(DispatchA= ction.java:274) at org.apache.struts.actions.DispatchAction.execute(Lorg.= apache.struts.action.ActionMapping;Lorg.apache.struts.action.ActionForm;L= javax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResp= onse;)Lorg.apache.struts.action.ActionForward;(DispatchAction.java:194) a= t org.apache.struts.actions.MappingDispatchAction.execute(Lorg.apache.str= uts.action.ActionMapping;Lorg.apache.struts.action.ActionForm;Ljavax.serv= let.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)Lorg= =2Eapache.struts.action.ActionForward;(MappingDispatchAction.java:169) at= org.apache.struts.action.RequestProcessor.processActionPerform(Ljavax.se= rvlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;Lor= g.apache.struts.action.Action;Lorg.apache.struts.action.ActionForm;Lorg.a= pache.struts.action.ActionMapping;)Lorg.apache.struts.action.ActionForwar= d;(RequestProcessor.java:419) at org.apache.struts.action.RequestProcesso= r.process(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.Http= ServletResponse;)V(RequestProcessor.java:224) at org.apache.struts.action= =2EActionServlet.process(Ljavax.servlet.http.HttpServletRequest;Ljavax.se= rvlet.http.HttpServletResponse;)V(ActionServlet.java:1194) at org.apache.= struts.action.ActionServlet.doGet(Ljavax.servlet.http.HttpServletRequest;= Ljavax.servlet.http.HttpServletResponse;)V(ActionServlet.java:414) at jav= ax.servlet.http.HttpServlet.service(Ljavax.servlet.http.HttpServletReques= t;Ljavax.servlet.http.HttpServletResponse;)V(HttpServlet.java:740) at jav= ax.servlet.http.HttpServlet.service(Ljavax.servlet.ServletRequest;Ljavax.= servlet.ServletResponse;)V(HttpServlet.java:853) at weblogic.servlet.inte= rnal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object;(Serv= letStubImpl.java:996) at weblogic.servlet.internal.ServletStubImpl.invoke= Servlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Lweb= logic.servlet.internal.FilterChainImpl;)V(ServletStubImpl.java:419) at we= blogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.Serv= letRequest;Ljavax.servlet.ServletResponse;)V(ServletStubImpl.java:315) at= weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.r= un()Ljava.lang.Object;(WebAppServletContext.java:6452) > > > >Regards, > >Vang Nguyen > >Enterprise Application Programmer >Department of Emergency Services >(61-7) 3247 8586 > > >This correspondence is for the named persons only. > >It may contain confidential or privileged information or both. > >No confidentiality or privilege is waived or lost by any mis transmissio= n. > >If you receive this correspondence in error please delete it from your s= ystem immediately and notify the sender. > >You must not disclose, copy or relay on any part of this correspondence,= if you are not the intended recipient. > >Any opinions expressed in this message are those of the individual sende= r except where the sender expressly, > >and with the authority, states them to be the opinions of the Department= of Emergency Services, Queensland. > > >------------------------------------------------------- >SF.Net email is Sponsored by the Better Software Conference & EXPO >September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practi= ces >Agile & Plan-Driven Development * Managing Projects & Teams * Testing & = QA >Security * Process Improvement & Measurement * http://www.sqe.com/bsce5s= f >_______________________________________________ >xdoclet-user mailing list >xdo...@li... >https://lists.sourceforge.net/lists/listinfo/xdoclet-user > =20 > |