6 Replies Latest reply: Dec 10, 2012 4:10 AM by Timo Hahn RSS

    How to set bind variable

      I am writing Junits for a view object and i need to paas the bind variable value . I have use the following code

      MaterialPOAMImpl am = (MaterialPOAMImpl)this.getApplicationModule();
      PoSchedAssociatedChargesVOImpl poAssociatedChargesVOImpl = (PoSchedAssociatedChargesVOImpl)am.getPoSchedAssociatedCharges1();

      When i am running this gives me java.long.casting exception.
      Can anyone plz help me what went wrong??

      Thanks in advance.
        • 1. Re: How to set bind variable
          Timo Hahn
          Have you checked that the data type of the bind breaks is long?
          It may be of type Number.

          • 2. Re: How to set bind variable
            Hi Timo
            Thanks for reply
            I have checked and it is of Long Type

            its giving this exception
            "java.lang.ClassCastException: oracle.apps.fnd.applcore.oaext.model.OAApplicationModuleImpl cannot be cast to oracle.apps.scm.landedCost.landedCosts.reviewPoDetails.uiModel.applicationModule.MaterialPOAMImpl"
            • 3. Re: How to set bind variable

              the casting happens in this line,

              PoSchedAssociatedChargesVOImpl poAssociatedChargesVOImpl = (PoSchedAssociatedChargesVOImpl)am.getPoSchedAssociatedCharges1();

              so you may want to check if am appmodule returns the right VO.
              check getPoSchedAssociatedCharges1() in the app module to see if it returns the right VO - assuming it has been hand changed by you and might have missed something.

              Or it may be that the VO is not part of the AM, or you have not exposed the View accessor methods exposed to the client in the AM or VO.
              • 4. Re: How to set bind variable
                Frank Nimphius-Oracle

                can't you read error messages ?

                oracle.apps.fnd.applcore.oaext.model.*OAApplicationModuleImpl* cannot be cast to oracle.apps.scm.landedCost.landedCosts.reviewPoDetails.uiModel.applicationModule.*MaterialPOAMImpl*"

                translates to ...

                OAApplicationModuleImpl <> MaterialPOAMImpl

                pointing to

                MaterialPOAMImpl am = *(MaterialPOAMImpl)this.getApplicationModule();*

                as the line causing the issue. You cast the AM to the wrong class. This is it

                • 5. Re: How to set bind variable
                  I am able to remove the casting exception now, but the code is not able to set the bind variable value. Any comments on that.

                  • 6. Re: How to set bind variable
                    Timo Hahn
                    No comment on that. We can't help if we don't know what error you get. 'it's not working' is no help at all.

                    Run the app with -Djbo.debugoutput=console to get a printout of the query send to the db.