A cmr-field and a cmp-field on the bean are using the same name. The names

Hi:
I am using weblogic 8.1 and MyEclipse 5.1.1. I am deploying my ear application through MyEclipse 5.1.1 as an ear file.
When I ran the following EJB QL:
SELECT OBJECT(p) FROM Product p.category = ?1
I get the following error:
n relation Category-Product, a cmr-field and a cmp-field on the bean are using the same name. The names of cmr and cmp fields must be unique.
It is basically complaining that I have a field
<cmr-field>
                         <cmr-field-name>category</cmr-field-name>
                    </cmr-field>
in my ejb-jar.xml and also the same category in the
<cmp-field><field-name>category</field-name></cmp-field>
field. The problem is that if I changed the value of the cmr-field, I have to add a get and set in my productLocal.java and when you do that you have to do the same in the ejb-jar.xml.
Here is my ejb-jar.xml:
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
"http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>CategoryEJB</ejb-name>
<local-home>com.CategoryHomeLocal</local-home>
<local>com.CategoryLocal</local>
<ejb-class>com.CategoryBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Category</abstract-schema-name>
     <cmp-field><field-name>categoryId</field-name></cmp-field>
<cmp-field><field-name>categoryName</field-name></cmp-field>
<cmp-field><field-name>picture</field-name></cmp-field>
<cmp-field><field-name>pictureWidth</field-name></cmp-field>
<cmp-field><field-name>pictureHeight</field-name></cmp-field>
<cmp-field><field-name>labelOn</field-name></cmp-field>
     <cmp-field><field-name>labelOff</field-name></cmp-field>
     <cmp-field><field-name>button</field-name></cmp-field>
<primkey-field>categoryId</primkey-field>
<security-identity><use-caller-identity/></security-identity>
          <query>
               <query-method>
                    <method-name>findCategory</method-name>
                    <method-params></method-params>
               </query-method>
               <ejb-ql>
                    SELECT OBJECT(c) FROM Category c
               </ejb-ql>
          </query>
     </entity>
     <entity>
<ejb-name>ProductEJB</ejb-name>
<local-home>com.ProductHomeLocal</local-home>
<local>com.ProductLocal</local>
<ejb-class>com.ProductBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Product</abstract-schema-name>
     <cmp-field><field-name>productId</field-name></cmp-field>
<cmp-field><field-name>brandName</field-name></cmp-field>
<cmp-field><field-name>productDescription</field-name></cmp-field>
<cmp-field><field-name>purchasePrice</field-name></cmp-field>
<cmp-field><field-name>category</field-name></cmp-field>
<primkey-field>productId</primkey-field>
<security-identity><use-caller-identity/></security-identity>
          <query>
               <query-method>
                    <method-name>findProduct</method-name>
                    <method-params>
                    <method-param>com.CategoryLocal</method-param>
                    </method-params>
               </query-method>
               <ejb-ql>
                    SELECT OBJECT(p) FROM Product p.category = ?1
               </ejb-ql>
          </query>
     </entity>
</enterprise-beans>
<relationships>
               <ejb-relation>
               <ejb-relation-name>Category-Product</ejb-relation-name>
               <ejb-relationship-role>
                    <ejb-relationship-role-name>
                         Category-has-many-Product-numbers
                    </ejb-relationship-role-name>
                    <multiplicity>one</multiplicity>
                    <relationship-role-source>
                         <ejb-name>CategoryEJB</ejb-name>
                    </relationship-role-source>
                    <cmr-field>
                         <cmr-field-name>productNumbers</cmr-field-name>
                         <cmr-field-type>java.util.Collection</cmr-field-type>
                    </cmr-field>
               </ejb-relationship-role>
               <ejb-relationship-role>
                    <ejb-relationship-role-name>
                         Product-belongs-to-Category
                    </ejb-relationship-role-name>
                    <multiplicity>many</multiplicity>
                    <cascade-delete/>
                    <relationship-role-source>
                         <ejb-name>ProductEJB</ejb-name>
                    </relationship-role-source>
                    <cmr-field>
                         <cmr-field-name>category</cmr-field-name>
                    </cmr-field>
               </ejb-relationship-role>
          </ejb-relation>
</relationships>
<assembly-descriptor>
<security-role>
<role-name>Employees</role-name>
</security-role>
<method-permission>
<role-name>Employees</role-name>
<method>
<ejb-name>CategoryEJB</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>
<container-transaction>
<method>
<ejb-name>CategoryEJB</ejb-name>
<method-name>*</method-name>
</method>
<method>
<ejb-name>ProductEJB</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>     
Here is my weblogic-cmp-rdbms-jar.xml:
<!DOCTYPE weblogic-rdbms-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB RDBMS Persistence//EN'
'http://www.bea.com/servers/wls810/dtd/weblogic-rdbms20-persistence-810.dtd'>
<weblogic-rdbms-jar>
<weblogic-rdbms-bean>
     <ejb-name>CategoryEJB</ejb-name>
<data-source-name>ShoeStore</data-source-name>
     <table-map>
          <table-name>category</table-name>
          <field-map>
          <cmp-field>categoryId</cmp-field>
          <dbms-column>categoryID</dbms-column>
          </field-map>
          <field-map>
          <cmp-field>categoryName</cmp-field>
          <dbms-column>categoryName</dbms-column>
          </field-map>
          <field-map>
          <cmp-field>picture</cmp-field>
          <dbms-column>Picture</dbms-column>
          </field-map>
          <field-map>
          <cmp-field>pictureWidth</cmp-field>
          <dbms-column>PictureWidth</dbms-column>
          </field-map>
          <field-map>
          <cmp-field>pictureHeight</cmp-field>
          <dbms-column>PictureHeight</dbms-column>
          </field-map>
          <field-map>
          <cmp-field>labelOn</cmp-field>
          <dbms-column>LabelOn</dbms-column>
          </field-map>
          <field-map>
          <cmp-field>labelOff</cmp-field>
          <dbms-column>LabelOff</dbms-column>
          </field-map>
          <field-map>
          <cmp-field>button</cmp-field>
          <dbms-column>Button</dbms-column>
          </field-map>
</table-map>
<automatic-key-generation>
<generator-type>SQL_SERVER</generator-type>
</automatic-key-generation>
</weblogic-rdbms-bean>
<weblogic-rdbms-bean>
     <ejb-name>ProductEJB</ejb-name>
<data-source-name>ShoeStore</data-source-name>
     <table-map>
          <table-name>PRODUCT</table-name>
          <field-map>
          <cmp-field>productId</cmp-field>
          <dbms-column>productId</dbms-column>
          </field-map>
          <field-map>
          <cmp-field>brandName</cmp-field>
          <dbms-column>brandName</dbms-column>
          </field-map>
          <field-map>
          <cmp-field>productDescription</cmp-field>
          <dbms-column>productDescription</dbms-column>
          </field-map>
          <field-map>
          <cmp-field>purchasePrice</cmp-field>
          <dbms-column>purchasePrice</dbms-column>
          </field-map>
          <field-map>
          <cmp-field>category</cmp-field>
          <dbms-column>categoryId</dbms-column>
          </field-map>
</table-map>
     <!-- Automatically generate the value of ID in the database on inserts using sequence table -->
<automatic-key-generation>
<generator-type>SQL_SERVER</generator-type>
</automatic-key-generation>
</weblogic-rdbms-bean>
<weblogic-rdbms-relation>
     <relation-name>Category-Product</relation-name>
<weblogic-relationship-role>
<relationship-role-name>Product-belongs-to-Category</relationship-role-name>
          <relationship-role-map>
<column-map>
<foreign-key-column>categoryId</foreign-key-column>
<key-column>categoryID</key-column>
</column-map>
          </relationship-role-map>
</weblogic-relationship-role>
</weblogic-rdbms-relation>
</weblogic-rdbms-jar>
Here is my productLocal.java:
package com;
import javax.ejb.CreateException;
import javax.naming.NamingException;
import java.util.Date;
import java.util.Vector;
import java.util.Collection;
public interface ProductLocal extends javax.ejb.EJBLocalObject
     public Integer getProductId();
     public void setProductId(Integer productId);
     public String getBrandName();
     public void setBrandName(String brandName);
     public String getProductDescription();
     public void setProductDescription(String productDescription);
     public Double getPurchasePrice();
     public void setPurchasePrice(Double purchasePrice);
public CategoryLocal getCategory();
     public void setCategory(CategoryLocal category);
Here is my ProductBean.java:
package com;
import javax.naming.InitialContext;
import javax.ejb.EntityContext;
import javax.ejb.CreateException;
import javax.naming.NamingException;
import java.util.Date;
import java.util.Collection;
import java.util.Iterator;
import java.util.Vector;
import java.lang.Integer;
public abstract class ProductBean implements javax.ejb.EntityBean
     public Integer ejbCreate(Integer id)
          this.setProductId(id);
          return null;
     public void ejbPostCreate(Integer id)
     //public abstract Integer getCategoryId();
//     public abstract void setCategoryId(Integer categoryId);
     public abstract CategoryLocal getCategory();
     public abstract void setCategory(CategoryLocal category);
     public abstract Integer getProductId();
     public abstract void setProductId(Integer productId);
     public abstract String getBrandName();
     public abstract void setBrandName(String brandName);
     public abstract String getProductDescription();
     public abstract void setProductDescription(String productDescription);
     public abstract Double getPurchasePrice();
     public abstract void setPurchasePrice(Double purchasePrice);
     public void setEntityContext(EntityContext ec)
          System.out.println("ProductBean setEntityContext");
     public void unsetEntityContext()
          System.out.println("ProductBean unsetEntityContext");
     public void ejbLoad()
          System.out.println("ProductBean ejbLoad");
     public void ejbStore()
          System.out.println("ProductBean ejbStore");
     public void ejbActivate()
          System.out.println("ProductBean ejbActivate");
     public void ejbPassivate()
          System.out.println("ProductBean ejbPassivate");
     public void ejbRemove()
          System.out.println("ProductBean ejbRemove");
What do I needed to do to fix this problem.
Any hint or help would be greatly appreciated!!!
Yours,
Frustrated

cmr field which is "category" in ur mapping , u can't use as cmp field in abstract schema mapping. just remove category from cmp field . and every thing is fine

Similar Messages

  • Key fields and non-key field of condition table

    Hello Gurus,
          what is key fields and non-key field of condition table?
    thanks very much!

    Key field
    Each condition table contains keys that can be used for creating dependent condition records.
    for example let take condition type PR00.
    PR00 uses access sequence PR02 .
    Access sequence PR02 has following tables associated with it namely 304, 305 & 306
    When you create a conditon record for PR00 with transaction VK11 or VK31, you have a button 'key combination' which is nothing but fields associated with tables 304, 305 & 306.
    In brief, Condition records are always created using specific keys. Condition tables are used to define the structure of the keys of a condition record.
    Non key field
    For example take condition table 144 - sales deal basic data.
    Table 144 is associated with access sequence PBUD.
    If you check the fields associated with this table (click technical view button), there are three fields at bottom which do not have 'key' check mark -KDATU, PLTYP, KSTAF
    So, when you create a condition record for PBUD, system does not propose these 3 fields in 'key combination' and hence are non key fields.
    Please reward points for good answers as this would help increase the total donation that SAP will make to the United Nations World Food Programme.

  • User Exit for validating overall limit field and expected limit field-ME2xN

    Dear Gurus,
    Can you please suggest me any user exit or BAdi to validate the overall limit field and expected limit field in transaction ME2xN.
    Or any other way to to achieve this functionality in ME2xN.
    Our Requirement is while raising a service PO in the Limits tab the 'Overall limit' should be same as 'Expected Value', at present the user can enter overall limit greater than 'Expected Value'.
    Regards,
    Priyank Joshi

    this will not work. you cannot add another structure (AUFK) on top of CEBAN. all characteristics have to be of one structure and since you want to release a PR it has to be CEBAN. before attempting to program something around that why do you not go to tx. OLME -> PR -> Release Strategy -> With Classfication -> Release Strategie and run it in a simulation mode. you will then see how it reacts.
    there's a white-paper on service.sap.com explaning in detail release-strategies. it's a good one and a good read too!

  • Profit center field and internal order field in sales order

    Hello all,
    I am unable to find the settings for profit center field and internal order field in sales order account assignment tab screen. kindly let me know the path and configuration settings.
    Thanks in advance
    Regards
    srinivas

    Hi Srinivas
    If you want to assign the profit center then make sure that the Profit center is assigned in MMR->Sales orgn 1 view . 
    But to assign the Profit center in MMR also you need to configure the Profit center first for your Material in your company code with the help of FI/CO consultants and then assign then the profit center will flow from MMR to sales order  item data->account assignment tab
    Regards
    Srinath

  • I have two albums (RCA Sweeny Todd 2 discs set and RCA Into the Woods 1 disc) where the songs are listed as being on the same album on the list view, but do not group together on the iPod, so the songs can't play consecutively, or in the proper order.

    I have two albums (RCA Sweeny Todd 2 discs set and RCA Into the Woods 1 disc) where the songs are listed as being on the same album on the list view, but do not group together on the iPod, so the songs can't play consecutively, or in the proper order. The "Apply Sort Field" and "Same album does not work, but ti is only these two RCA albums that do this. All other albums remain intact. Need help with this minor problem. Thanks.

    UPDATE: This behavior (to an extent) still happens when "Repeat Album" is off. Instead of an infinite loop, it goes through all the tracks on the album (unsuccessfully) and kicks me out to the Album overview screen. Going back to list of Albums and tapping the Album again brings up "No Content: You can download music from the iTunes Store" but that screen immediately kicks me back to list of Albums.
    So I am just even more confused now.

  • If I use the same iCloud account for my ipad and iPhone, will changes I make on one change on the other as well?  I'm not sure of the advantage of using teh same iCloud for both devices.

    If I use the same iCloud account for my ipad and iPhone, will changes I make on one change on the other as well?  I'm not sure of the advantage of using teh same iCloud for both devices.

    No, it only mirrors changes to synced data.  This includes mail, contacts, calendars, reminders, safari bookmarks, notes, iWork documents and data, and photo stream photos (assuming you choose to sync all this data).  Changes to iTunes data such as music, apps, podcasts, etc., are not synced using iCloud.  In your example, if you delete an app from one device it will remain on the other until deleted there too.

  • I am totally frustrated by the fact that now i have gone to iCloud and after a few synchs, my contacts are all mixed up with the wrong information.  For instance, my email and phone number comes up under someone else's name (a thousand contacts)

    I am totally frustrated by the fact that now i have gone to iCloud and after a few synchs, my contacts are all mixed up with the wrong information.  For instance, my email and phone number comes up under someone else's name (a thousand contacts).  I dont know how to repair this.  what a nightmare

    An icloud account is designed to be used by just one user.  If you have given your ID or set up your account on someone else's device, then their data will be mingled with your or worse.

  • Upon entering a LV project file into VSS, all files in the project are left out. Only the project shell and settings enter VSS. Any idea why?

    Upon entering a LV project file into VSS, all files in the project are left out. Only the project shell and settings enter VSS. Any idea why?
    Solved!
    Go to Solution.

    Chuck72352,
    Hello! It is my understanding that you need to add the individual files to the Source Code Control along with the .lvproj file.
    Here is a great deal of information on Source Code Control Practices in LabVIEW.
    Ben Sisney
    FlexRIO V&V Engineer
    National Instruments

  • If my iPhone was stolen and i want to reactive an old phone using that same number for the time being while i waited to see if I could get my iPhone back, would the iPhone still work while i was using a re-activated old phone of mine?

    If my iPhone was stolen and i want to reactive an old phone using that same number for the time being while i waited to see if I could get my iPhone back, would the iPhone still work while i was using a re-activated old phone of mine?

    If a new SIM is activated on the same account for the same number, any existing SIMs for that number are deactivated.
    Why exactly would you care if the SIM in the missing device still works or not?

  • I just update my iMac from Mountain Lion to Mavericks and the application are slow to open. The same happens to opening webpages . Please help

    just update my iMac from Mountain Lion to Mavericks and the application are slow to open. The same happens to opening webpages . Please help

    Resetting your Mac's PRAM and NVRAM
    Intel-based Macs: Resetting the System Management Controller (SMC)
    Restart the computer in Safe Mode, then restart again, normally. If this doesn't help, then:
    Reinstalling Mavericks, Lion/Mountain Lion Without Erasing the Drive
    Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
    Reinstall Lion/Mountain Lion, Mavericks: Select Reinstall Lion/Mountain Lion, Mavericks and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.

  • When I copy and paste from Word to my e-mail using Firefox it changes the font and spacing to single and 10pt. It just started doing this a month ago. It does not do it when I am on my laptop or using Explorer. Help, I hate explorer.

    When I copy and paste from Word to my e-mail using Firefox it changes the font and spacing to single space and 10pt.
    It just started doing this a month ago.
    It does not do it when I am on my laptop or using Explorer.
    Help, I hate explorer.

    If this were a project that I was involved in, I would recapture the media at the correct frame rate and rebuild the sequences correctly.
    Moving from production, to post production, to delivery is a series of steps, and the success of any particular step is based on having all the preceding steps done correctly.
    Shortcuts and workarounds tend to create awkward and difficult problems, that often only surface late in the process.
    MtD

  • Appears and quickly disappears a new screen overlaying the screen in use, it starts at the bottom of the screen tela.MACbook pro retina.O what could be causing this?

    appears and quickly disappears a new screen overlaying the screen in use, it starts at the bottom of the screen tela.MACbook pro retina.O what could be causing this?

    Thanks for the suggestion, the next step was to call Apple, who gave me a claim number, which I discovered you must have to get anything done with them.  They refered me to a Apple store or repair center, after some reseach took it to the Computer Store in Mobile, Alabama and they were excellent.  They took pictures of the screen with bug submitted it to Apple who denied the claim but they kept kicking it up to the next level and finally Apple agreed to sent new cover.  The Computer Store had the cover the next day, they changed it out and now I am bug free.  If your in the area of Mobile Alabama you can feel good about getting help from the Computer Store.  For the two folks that responded to my note, Thank You, good comments and good advice.

  • I have forgotten my security question and I have tried for to days for uses to send me the resets and the email is not coming though?

    I have forgotten my security question and I have tried for to days for uses to send me the resets and the email is not coming though?

    If you've been unsuccessful resetting your security questions by signing into your account at appleid.apple.com (manage my apple I'd) and the going to password and security, and have also tried contacting iTunes support and have not heard back then:
    Call 1-800-APL-CARE and have the following info ready:
    Your verifiable and active apple I'd username, the serial number of a device registered in your name, and some billing info currently associated with your account.

  • I have a website for my artwork.  I had a PC and. Now an iMAC.  I've used Dreamweaver to update the website.  I used to go to Filezilla on the PC a upload the updated pages which would then show updated on the internet.  What file like FileZilla should I

    I have a website for my artwork.  I had a PC and. Now an iMAC.  I've used Dreamweaver to update the website.  I used to go to Filezilla on the PC a upload the updated pages which would then show updated on the internet.  What file like FileZilla should I use?

    You can download it here:
    https://filezilla-project.org/download.php?show_all=1
    Click the Source Forge link - make sure you reject offers for any other software during the installation, Source Forge usually will ask you to install other stuff in addition to what you want (Filezilla).
    It works well on Mac.
    Dreamweaver also has built-in FTP functionality if you want to check that out.

  • I have around 2000 photos on my camera roll as back up and now i am not able to delete unwanted photos and they are not even getting synced wid d computer so what should i do now?? they are using 9 gb of the space!!!

    i have around 2000 photos on my camera roll as back up and now i am not able to delete unwanted photos and they are not even getting synced wid d computer so what should i do now?? they are using 9 gb of the space!!!

    Chris CA wrote:
    You cannot backup photos to iCloud.
    You can enable Photo Stream (in Settings > iCloud) but only for 30 days and only a max of 1000 photos.
    Then what does this mean? It was copied from the kb article that I posted above.
    Reducing the size of your Camera Roll backup
    If you take lots of photos and videos with your iOS device, you may notice your Camera Roll takes up most of your iCloud Storage backup. To check the size of the Camera Roll backup on your device:
    On your Home Screen, tap Settings.
    Tap iCloud.
    Tap Storage & Backup.
    Tap Manage Storage.
    In the Backups section, tap your device.
    In the Backup Options section, the backup size is displayed under Camera Roll.
    To reduce the size of your Camera Roll backup, save your photos and videos locally to your computer with iTunes, and then manually back up your iOS device. If you want to keep your photos and videos on your iOS device, you can turn off Camera Roll in Backup (see the "Deleting backups and turning off Backup for your Device" section above) orpurchase additional storage.

Maybe you are looking for

  • Error when submitting podcast: We had difficulty reading this feed. host parameter is null

    I'm attempting to submit a podcast through iTunes and keep getting this error. I've tried on two computers, one being a Mac and one PC. My RSS feed is here: http://www.whitewolfdental.com/wp-content/media/rss.xml If I go to File -> Subscribe to Podca

  • Aligned in Firefox but not in IE.

    I'm a complete newbie to webdesign have a wee problem.  Whilst designing a website I was testing totally out of firefox, website goes live and check it at work... not aligned.  Can anyone help? Have posted the code below. Huge thanks to anyone inadva

  • Cannot directly read PDFs

    I can open Adobe Reader via its shortcut, then open a PDF from there. However, I cannot open a PDF "directly" by right-clicking on its icon and telling it to open with Adobe Reader. When I try to do that, Adobe Reader opens for a split second and the

  • SWF Export Image Quality Issue

    I'm having an issue with a flip eFlyer myself and a colleague are working on in InDesign CS4 and need some input. We've created a eFlyer with page curl transitions and exported the swf file. When viewing the swf however, the page images vary in quali

  • I CAN SELECT A ITEM WITH TRACK PAD, But can not open the item

    Mac Book 15 inch OS X 10.10 New to Mac Using track pad I can select an item by one click but can not open this item with 2 clicks.