12 Replies Latest reply: Feb 16, 2011 4:44 AM by 839957 RSS

    HELP URGENT - Entity Object Substitution not working as advertised!!!!!

    839957
      Hi All,

      I have done an entity Object substitution and in order to rule out any coding errors on my part I have generated a fresh EO with no code changes in it and uploaded the files to java top and updated the MDS with the substitution.

      The substitution is successful but I get the following error related to my substituted file:

      oracle.apps.fnd.framework.OAException: oracle.jbo.AttrValException: JBO-27019: Get method for attribute "ItemNumber" in XxEgoMtlSystemItemsVLEOEx could not be resolved. at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:912) at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1169) at oracle.apps.fnd.framework.webui.OAPageBean.renderDocument(OAPageBean.java:3241) at oracle.apps.fnd.framework.webui.OAPageBean.renderDocument(OAPageBean.java:3036)
      .......

      ## Detail 0 ## java.lang.ClassCastException: oracle.jbo.server.EntityDefImpl incompatible with oracle.apps.fnd.framework.server.OAEntityDefImpl at oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEOImpl.getDefinitionObject(EgoMtlSystemItemsVLEOImpl.java:562) at oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEOImpl.getItemNumber(EgoMtlSystemItemsVLEOImpl.java:11324) at oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEOImpl.getAttrInvokeAccessor(EgoMtlSystemItemsVLEOImpl.java:6888)

      ........

      I think the real error is Detail 0 line but I haven't seen this before. Could this be the wrong version of JDeveloper that I have used????? About this page showed 12.1.2 and I have downloaded the JDev for 12.1.2???????

      Please help I need to sort this ASAP.

      Thanks all
        • 1. Re: HELP URGENT - Entity Object Substitution not working as advertised!!!!!
          Gyan Darpan
          Hi,

          This error is not due to the wrong version of JDeveloper. Had you created some transient variable called ItemNumbe in XxEgoMtlSystemItemsVLEOEx.

          This error occurs when there is no method called getItemNumber in EoImpl.java. This is auto generated method.

          Specify me on which action does this error occurs. And what are steps you followed for EO extension.

          Regards,
          Gyan
          • 2. Re: HELP URGENT - Entity Object Substitution not working as advertised!!!!!
            839957
            Hi,

            I have not added any attributes.

            Steps to do substitution

            1. Created EO to extend base eo
            2. Clicked Next to end of wizard and left all options defaulted
            3. generated jpx file and uploaded using jpxImporter
            4. Bounced OC4J

            The substitution is working but something is wrong with the inheritance process as it cant invoke the getter on the parent class????

            Is this due to the options on Java generation?? I have the following set:

            Entity Collection Class: Not Generated

            Entity Object Class: Checked with options selected for Generate Methods: "Accessors" (Data Manipulation, Validation, Create and Remove Methods) are not checked

            Entity Definition Class: Not Generated

            Thanks for quick response, need to get this sorted

            Keith
            • 3. Re: HELP URGENT - Entity Object Substitution not working as advertised!!!!!
              Gyan Darpan
              Keith,

              Generate the relevant java files & all the accessor method. & run the same.

              Regards,
              Gyan
              • 4. Re: HELP URGENT - Entity Object Substitution not working as advertised!!!!!
                839957
                I just have, I generated everything except Data Manipulation and it still does not work

                Any more ideas???????

                Keith
                • 5. Re: HELP URGENT - Entity Object Substitution not working as advertised!!!!!
                  839957
                  Correct me if I am wrong but should the fact that my class extends the original not mean that if someone calls a method in the parent class against my class then it should invoke the parent class successfully even if I have not explicitly added the method to my new class and called the super???

                  Keith
                  • 6. Re: HELP URGENT - Entity Object Substitution not working as advertised!!!!!
                    Gyan Darpan
                    Keith,

                    You are completely right. As your child class inherits the parent, there is no need to define the method unless & until you want to change some logic. I am working on your requirement. let me check..

                    Regards,
                    Gyan
                    • 7. Re: HELP URGENT - Entity Object Substitution not working as advertised!!!!!
                      839957
                      Ok some more information

                      I have now moved on to try and do my extension in one of the VO setters

                      when I run the following code all works as expected

                      public void setInventoryItemId(Number value) {
                      setAttributeInternal("InventoryItemId", value);
                      OADBTransaction trx = (OADBTransaction)this.getApplicationModule().getTransaction();

                      if ("Y".equals("Y"))
                      {
                      setAttributeInternal("ItemNumber","PIMTMP"+trx.getSequenceValue("XXAN_TMP_SEQUENCE"));
                      }
                      }

                      but as soon as I try to access one of the getter methods like this


                      public void setInventoryItemId(Number value) {
                      setAttributeInternal("InventoryItemId", value);
                      OADBTransaction trx = (OADBTransaction)this.getApplicationModule().getTransaction();

                      if (getAttributeInternal("StyleItemFlag").toString().equals("Y"))
                      {
                      setAttributeInternal("ItemNumber","PIMTMP"+trx.getSequenceValue("XXAN_TMP_SEQUENCE"));
                      }
                      }

                      Then I get a similar error message to the one I was getting in my EO

                      Set method for attribute \"InventoryItemId\" in EgoMtlSystemItemsVO could not be resolved

                      What the heck is stopping me from calling getter methods but not setters???????

                      Keith
                      • 8. Re: HELP URGENT - Entity Object Substitution not working as advertised!!!!!
                        781651
                        1.
                        in order to rule out any coding errors on my part I have generated a fresh EO with no code changes in it
                        Does that mean, you have created a new EO instead of extending standard EO ? Pls elaborate.

                        2. Refer

                        http://kr.forums.oracle.com/forums/thread.jspa?threadID=671452
                        http://oraclearea51.com/technical-articles/r12-tutorials/298-eo-extension-in-oa-framework.html

                        -Anand
                        • 9. Re: HELP URGENT - Entity Object Substitution not working as advertised!!!!!
                          839957
                          Physically created a new class file yes but it extends the base class
                          • 10. Re: HELP URGENT - Entity Object Substitution not working as advertised!!!!!
                            839957
                            I have covered everything in the above threads and followed the EO substitution scenario exactly as per area51.

                            I am now getting a different error on the EO substitution, when the page loads that creates a row in the EO the following error is displayed:

                                 
                                      
                            Error

                            1. Attribute set for InventoryItemId in view object EgoMtlSystemItemsVO failed
                            2. Attribute set for InventoryItemId in view object EgoMtlSystemItemsVO failed
                            3. Attribute set for InventoryItemId in view object EgoMtlSystemItemsVO failed
                            4. Attribute set for InventoryItemId in view object EgoMtlSystemItemsVO failed

                            This is a caught error and thrown to the top of the page as opposed to a complete stack error which is what I was getting before? At first I thought this was due to the VO substitution I had done earlier as a test but I have deleted the substitution document for the VO sub and if I remove my EO substitution the page works fine so my EO substitution is causing the problem.

                            EO substitution was as follows:
                            <Substitutes>
                            <Substitute OldName ="oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEO" NewName ="xxsdg.oracle.apps.ego.item.eu.server.XxEgoMtlSystemItemsVLEOEx" />
                            </Substitutes>


                            Beginning of EO Code is as follows:


                            package xxsdg.oracle.apps.ego.item.eu.server;

                            import oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEOImpl;
                            import oracle.apps.fnd.framework.server.OAEntityDefImpl;

                            import oracle.jbo.AttributeList;
                            import oracle.jbo.domain.Date;
                            import oracle.jbo.domain.Number;
                            import oracle.jbo.domain.RowID;
                            import oracle.jbo.server.AttributeDefImpl;
                            import oracle.jbo.server.EntityDefImpl;
                            // ---------------------------------------------------------------------
                            // --- File generated by Oracle ADF Business Components Design Time.
                            // --- Custom code may be added to this class.
                            // --- Warning: Do not modify method signatures of generated methods.
                            // ---------------------------------------------------------------------
                            public class XxEgoMtlSystemItemsVLEOExImpl extends EgoMtlSystemItemsVLEOImpl {
                            public static final int MAXATTRCONST = EntityDefImpl.getMaxAttrConst("oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEO");
                            public static final int GLOBALATTRIBUTE11 = MAXATTRCONST;
                            public static final int GLOBALATTRIBUTE12 = MAXATTRCONST + 1;
                            public static final int GLOBALATTRIBUTE13 = MAXATTRCONST + 2;
                            public static final int GLOBALATTRIBUTE14 = MAXATTRCONST + 3;
                            public static final int GLOBALATTRIBUTE15 = MAXATTRCONST + 4;
                            public static final int GLOBALATTRIBUTE16 = MAXATTRCONST + 5;
                            public static final int GLOBALATTRIBUTE17 = MAXATTRCONST + 6;
                            public static final int GLOBALATTRIBUTE18 = MAXATTRCONST + 7;
                            public static final int GLOBALATTRIBUTE19 = MAXATTRCONST + 8;
                            public static final int GLOBALATTRIBUTE20 = MAXATTRCONST + 9;
                            public static final int ROWID = MAXATTRCONST + 10;
                            private static OAEntityDefImpl mDefinitionObject;

                            /**This is the default constructor (do not remove)
                            */
                            public XxEgoMtlSystemItemsVLEOExImpl() {
                            }

                            /**Retrieves the definition object for this instance class.
                            */
                            public static synchronized EntityDefImpl getDefinitionObject() {
                            if (mDefinitionObject == null) {
                            mDefinitionObject =
                            (OAEntityDefImpl)EntityDefImpl.findDefObject("xxsdg.oracle.apps.ego.item.eu.server.XxEgoMtlSystemItemsVLEOEx");
                            }
                            return mDefinitionObject;
                            }

                            /**Add attribute defaulting logic in this method.
                            */
                            public void create(AttributeList attributeList) {
                            super.create(attributeList);
                            }

                            ....
                            • 11. Re: HELP URGENT - Entity Object Substitution not working as advertised!!!!!
                              839957
                              OK, so after moving to another environment I am now getting a better error message and it seems that the EO substitution is causing a problem with the bind attributes for the VO Query that sits ontop of the EO??? No idea why my understanding of the substitution framework is that I would not have to worry about the activity on the parent VO's/EO's but clearly something is either wrong with the mechanism or something is strange about this OAF application implementation (Product Data Hub aka PIM), to be honest I would not be suprised to find that it is the way the application has been wrote as I have seen some poor standards in this app already.

                              The EO substitution is a lost cause so I have implemented my attribute defaulting in the VO instead by using one of the setters, so rather than:

                              public void setInventoryItemId(Number value) {
                              setAttributeInternal("InventoryItemId", value);
                              OADBTransaction trx = (OADBTransaction)this.getApplicationModule().getTransaction();

                              if (super.getStyleItemFlag().compareTo("Y")==0)
                              {
                              setAttributeInternal("ItemNumber","PIMTMP"+trx.getSequenceValue("XXAN_TMP_SEQUENCE"));
                              }
                              }

                              I am doing:

                              public void setStyleItemFlag(String value) {
                              setAttributeInternal("StyleItemFlag", value);
                              OADBTransaction trx = (OADBTransaction)getApplicationModule().getTransaction();
                              if (value.equals("Y") )
                              {
                              setAttributeInternal("ItemNumber","PIMTMP"+trx.getSequenceValue("XXAN_TMP_SEQUENCE"));
                              }
                              }

                              Has the same affect and it works because I am not calling a get method

                              If anyone has anymore insight into this I would be interested to understand what the problem is as this process is certainly not working in the way that Oracle say it should!!!!

                              Keith
                              • 12. Re: HELP URGENT - Entity Object Substitution not working as advertised!!!!!
                                839957
                                Further Discovery: The error message about the method not being resolved basically means that an error has occurred in the extended code!!! I had a null value coming into my parameters from the database and I hadn't put a handler in top test for this, rather than giving me a helpful error message OAF has decided to pretend it cant find the method!!!!!!

                                Test for nulls and handle them and it sorts this problem as regards the VO extension, from the EO perspective I think my problem is module specific although I must admit I have not looked into this further.

                                Keith