RE: Error Deploying beans with relationships to weblogic
Ben Litchfield <[email protected]>
| Newsgroups | gmane.comp.java.ejb.middlegen.user |
|---|---|
| Message-ID | <[email protected]> |
Thanks for the reply but none of my table names match columns in them. This is a bidirectional one-many relationship. Did you have to set anything in the gui to get it to work? I left everything as the default. Any other thoughts on what it might be? Ben On Mon, 6 Oct 2003, Higdon, Brian [VIS-Non J&J] wrote: > I had something similar over the weekend and this is what I found. > > Let's say there is a table called 'Asset_Type' with a primary key called > 'Asset_type_cd'. Then you have a foreign key from another table, let's say > 'Asset' which uses the asset_type_cd field to get the related asset_type. > This should work fine. > > Now let's say that instead of calling the table 'Asset_type' you goof (like > I did) and call it 'Asset_type_cd' with a primary key of 'Asset_type_cd'. > Then when the attempt is to made to create the FK relationship, their is a > clash in the names and that is most likely what your problem is. Just > rename either your table or the primary key of the table and all the FKs > that refer to it and you should be fine. > > BTW, yes, I have deployed to Weblogic 7 and things work fine. My problem > now is I have ~120 tables which results in ~620 files in my jar file and > weblogic.ejbc fails on an OutOfMemory error regardless of my ms/mx > parameters. > > HTH > > -----Original Message----- > From: Ben Litchfield [mailto:[email protected]] > Sent: Sunday, October 05, 2003 11:36 AM > To: [email protected] > Subject: [Middlegen-user] Error Deploying beans with relationships to > weblogic > > > > Has anybody been able to deploy to weblogic? I am using local entity > beans and the local facade pattern. > > The application deploys but when I try to create beans with relationships > I get the following error > > javax.ejb.EJBException: [EJB:010145]When a cmp-field and a cmr-field > (relationship) are mapped to the same column, the setXXX method for the > cmp-field may not be called. The cmp-field is read-only. > > The generated code looks like this and bombs on the setVendorId call. > > public java.lang.Integer ejbCreate(slims.entity.TitleLightValue value) > throws javax.ejb.CreateException { > // Use Middlegen's Sequence Block PK generator. Only works for > numeric fields > try { > slims.entity.SequenceSession sequenceGenerator = > slims.entity.SequenceSessionUtil.getLocalHome().create(); > setTitleId(new > java.lang.Integer(Integer.toString(sequenceGenerator.getNextSequenceNumber( > "title.title_id" )))); > } catch( javax.naming.NamingException e ) { > throw new javax.ejb.CreateException(e.getMessage()); > } > setVendorId(value.getVendorId()); > setName(value.getName()); > // EJB 2.0 spec says return null for CMP ejbCreate methods. > return null; > } > > /** > * The container invokes this method immediately after it calls > ejbCreate. > * > * @param value the value object used to initialise the new instance > */ > public void ejbPostCreate(slims.entity.TitleLightValue value) throws > javax.ejb.CreateException { > } > > > Any help would be great. > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > middlegen-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/middlegen-user > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf