1 2 Previous Next 22 Replies Latest reply on Jul 12, 2010 8:32 PM by 479158

    Extending controller ByrAddrCO

    479158
      Hi,
      I am extending the controller 'ByrAddrCO'. I am not able to fetch data from any VO. I am getting NULL pointer exception at the 3rd line.

      I am doing the following

      OAApplicationModule xam = paramOAPageContext.getApplicationModule(paramOAWebBean);
      OAViewObjectImpl DffVO = (OAViewObjectImpl)xam.findViewObject("HzPuiPartySiteVO");
      OAViewRowImpl DffRow = (OAViewRowImpl)DffVO.getCurrentRow();

      let me know what i am doing wrong.

      Thanks,
      Kiran M.
        • 1. Re: Extending controller ByrAddrCO
          Anoop Singh
          Hi Kiran,

          can you print the stack trace of the error.

          Meanwhile you can also try with the below line...

          OAViewRowImpl DffRow = (OAViewRowImpl)DffVO.first();

          Anoop
          • 2. Re: Extending controller ByrAddrCO
            AnilSharma
            import oracle.apps.fnd.framework.OARow;

            OAApplicationModule xam = paramOAPageContext.getApplicationModule(paramOAWebBean);
            OAViewObjectImpl DffVO = (OAViewObjectImpl)xam.findViewObject("HzPuiPartySiteVO");

            if (DffVO != null)
            *{*
            DffVO.reset();
            DffVO.first();
            OARow row = (OARow)DffVO.getCurrentRow();
            *}*

            Thanks
            --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
            • 3. Re: Extending controller ByrAddrCO
              Reetesh Sharma
              Hi Kiran,

              The current Row always point to row no -1 which does not exist, hence a null pointer exception.
              Before using getcurrentrow we shpuld use some setCurrentrow to set some row of VO as current row.

              Regards,
              Reetesh Sharma
              • 4. Re: Extending controller ByrAddrCO
                479158
                Thansk for the replies guyz,

                ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                Hi Anil,
                I did the following

                if(paramOAPageContext.getParameter("applyBtn") != null)
                {
                super.processFormRequest(paramOAPageContext, paramOAWebBean);

                OAApplicationModule xam = paramOAPageContext.getApplicationModule(paramOAWebBean);
                OAViewObjectImpl DffVO = (OAViewObjectImpl)xam.findViewObject("HzPuiPartySiteVO");

                if (DffVO != null)
                {
                DffVO.reset();
                DffVO.first();
                OARow row = (OARow)DffVO.getCurrentRow();

                throw new OAException("Testing"+row.getAttribute("Addressee"),OAException.ERROR );
                }
                else
                {
                throw new OAException("DFFVO is NULL",OAException.ERROR );
                }

                I am going to the else condition so looks like DffVO is NULL.

                ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                Hi Anoop,
                I tried the following

                if(paramOAPageContext.getParameter("applyBtn") != null)
                {
                super.processFormRequest(paramOAPageContext, paramOAWebBean);

                OAApplicationModule xam = paramOAPageContext.getApplicationModule(paramOAWebBean);
                OAViewObjectImpl DffVO = (OAViewObjectImpl)xam.findViewObject("HzPuiPartySiteVO");
                //OAViewRowImpl DffRow = (OAViewRowImpl)DffVO.getCurrentRow();
                OAViewRowImpl DffRow = (OAViewRowImpl)DffVO.first();

                if (paramOAPageContext.getParameter("PosPartySiteId") != null)
                {
                throw new OAException("You cannot"+DffRow.getAttribute("Addressee"),OAException.ERROR );
                }

                The error stack is as follows

                Exception Details.
                oracle.apps.fnd.framework.OAException: java.lang.NullPointerException
                     at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:896)
                     at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1169)
                     at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1435)
                     at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2850)
                     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1838)
                     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:536)
                     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:424)
                     at OA.jspService(_OA.java:212)
                     at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
                     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)
                     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
                     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
                     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
                     at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
                     at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
                     at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
                     at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
                     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
                     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:359)
                     at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
                     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
                     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
                     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
                     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
                     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
                     at java.lang.Thread.run(Thread.java:595)
                ## Detail 0 ##
                java.lang.NullPointerException
                     at xxtjx.oracle.apps.pos.supplier.webui.XXTJXByrAddrCO86.processFormRequest(XXTJXByrAddrCO86.java:48)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:815)
                     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
                     at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1189)
                     at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
                     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
                     at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
                     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
                     at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
                     at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2846)
                     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1838)
                     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:536)
                     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:424)
                     at OA.jspService(_OA.java:212)
                     at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
                     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)
                     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
                     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
                     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
                     at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
                     at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
                     at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
                     at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
                     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
                     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:359)
                     at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
                     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
                     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
                     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
                     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
                     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
                     at java.lang.Thread.run(Thread.java:595)
                java.lang.NullPointerException
                     at xxtjx.oracle.apps.pos.supplier.webui.XXTJXByrAddrCO86.processFormRequest(XXTJXByrAddrCO86.java:48)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:815)
                     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
                     at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1189)
                     at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
                     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
                     at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:1027)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:993)
                     at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:848)
                     at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:382)
                     at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
                     at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2846)
                     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1838)
                     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:536)
                     at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:424)
                     at OA.jspService(_OA.java:212)
                     at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
                     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)
                     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
                     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
                     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
                     at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
                     at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
                     at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
                     at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
                     at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
                     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:359)
                     at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
                     at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
                     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
                     at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
                     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
                     at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
                     at java.lang.Thread.run(Thread.java:595)


                ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

                Hi Reetesh,
                can you elaborate what do you mean or give me an example, that would be really helpfull.

                Thanks,
                Kiran M.
                • 5. Re: Extending controller ByrAddrCO
                  750918
                  I think the you are not passing the correct value to findViewObject

                  OAViewObjectImpl DffVO = (OAViewObjectImpl)xam.findViewObject("*HzPuiPartySiteVO*");

                  Check the corresponding AM which has this VO


                  For Example


                  <?xml version="1.0" encoding='windows-1252'?>
                  <!DOCTYPE AppModule SYSTEM "jbo_03_01.dtd">

                  <!-- $Header: DebugLabAM.xml 120.7 2005/07/12 11:03:20 atgops1 noship $ -->

                  <AppModule
                  Name="DebugLabAM"
                  ComponentClass="oracle.apps.fnd.framework.toolbox.labsolutions.server.DebugLabAMImpl"
                  LoadComponentsLazily="true" >
                  <DesignTime>
                  <Attr Name="_isCodegen" Value="true" />
                  <Attr Name="_version" Value="9.0.3.12.25" />
                  <Attr Name="_deployType" Value="0" />
                  </DesignTime>
                  <ViewUsage
                  Name="DebugLabEmpSummaryVO1"
                  ViewObjectName="oracle.apps.fnd.framework.toolbox.labsolutions.server.DebugLabEmpSummaryVO" >
                  </ViewUsage>

                  To get the reference of the VO DebugLabEmpSummaryVO
                  I am passing DebugLabEmpSummaryVO1 to findViewObject method as argument.

                  OAViewObjectImpl DffVO = (OAViewObjectImpl)xam.findViewObject("*DebugLabEmpSummaryVO1*");


                  Regards,
                  Gourab
                  • 6. Re: Extending controller ByrAddrCO
                    Reetesh Sharma
                    Hi Kiran,

                    Sample code to set current row

                    Row masterRow = row;
                    vo.setCurrentRow(masterRow);

                    If have done Msater Detail page, in which we clicks one row and it displays the detail of that, detail will be displayed only for current row in that case we used to set selected row as Current row, hope this will give you some clue.

                    Kiran, one more thing I want to know which line is throwing a Null pointer exception,

                    OARow row = (OARow)DffVO.getCurrentRow();??? or the row you used to find View Object itself.

                    One more thing I could not understand, if you are pointing to VO's first row why you need current row??? Till you have not set the current row you can't access the current row.


                    Regards,
                    Reetesh Sharma

                    Edited by: Reetesh Sharma on May 16, 2010 10:02 PM
                    • 7. Re: Extending controller ByrAddrCO
                      479158
                      Hi Gourab,
                      I am using the correct VO only, as i am extending the base controller of this page 'ByrAddrCO', i am assuming i can call any VO and get their attributes.

                      Please correct me if i am wrong, If you have time, can you please extend the same controller and get an attribute of the VO (HzPuiPartySiteVO) and let me know if it works.


                      Hi Reetesh,
                      I am getting the NULL pointer exception at line


                      OAViewRowImpl DffRow = (OAViewRowImpl)DffVO.first();


                      Thanks,
                      Kiran M.

                      Edited by: kiran moluguri on May 19, 2010 9:28 AM
                      • 8. Re: Extending controller ByrAddrCO
                        Braj Pratap
                        HI

                        as u already tried so many codes ,one question ,do you have more then one AM on the page ?? if yes pls find out to which AM is containing this VO.pls let me know the answer of question ,is there more then one AM on this page .

                        thanx
                        Pratap
                        • 9. Re: Extending controller ByrAddrCO
                          479158
                          Hi Pratap,
                          yes, there are more than one AM's on this page, the VO i am trying to use is actually under the AM 'HzPuiAddressAM', more over i am able to call this VO by extending the controller attached to this AM, which is 'HzPuiAddressCreateUpdateCO', but the problem here was that, when i cancel any update, it was committing the wrong information to the database, so i thought there is some additional functionality in the base CO which is commiting the information though i cancel it, so i thought i would extend the base CO rather than extending the actual controller, but i am not able to call those VO's and get the attribute values, in the base controllers.

                          Let me know if you have any questions pratap.

                          Thanks,
                          Kiran M.

                          Edited by: kiran moluguri on May 20, 2010 6:24 AM
                          • 10. Re: Extending controller ByrAddrCO
                            Braj Pratap
                            hi ,


                            thats what i wanted to know ,in your base co use the below code to get the VO

                            OAApplicationModule am = pageContext.getRootApplicationModule(webBean);
                            OAApplicationModule childam=am.findApplicationModule("Give the AM name which is containing this VO")
                            OAViewObject VO= (OAViewObject)childam.findViewObject("VO name") ;

                            this will not return null and will definitely solve your problem ,let me know in case of any issue .


                            thanx
                            Pratap
                            • 11. Re: Extending controller ByrAddrCO
                              479158
                              Hi Pratap,
                              I am trying the following

                              public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
                              {
                              if(paramOAPageContext.getParameter("applyBtn") != null)
                              {
                              super.processFormRequest(paramOAPageContext, paramOAWebBean);

                                   OAApplicationModule am = paramOAPageContext.getRootApplicationModule(paramOAWebBean); //Line 46
                              //OAApplicationModule am = (OAApplicationModule)paramOAPageContext.getRootApplicationModule();
                                   OAApplicationModule childam = am.findApplicationModule("HzPuiAddressAM")
                                   OAViewObject VO = (OAViewObject)childam.findViewObject("HzPuiPartySiteVO") ;


                              I am getting the following error while compiling

                              Error(46,46): method getRootApplicationModule(oracle.apps.fnd.framework.webui.beans.OAWebBean) not found in interface oracle.apps.fnd.framework.webui.OAPageContext
                              • 12. Re: Extending controller ByrAddrCO
                                700122
                                Hi,

                                Use following to get both RootAM and AM associated with Bean.

                                OAApplicationModule am = pageContext.getRootApplicationModule();
                                OAApplicationModule beanAM = pageContext.getApplicationModule(webBean);

                                Check the item which is using that vo to get bean AM. If another controller is attached with that item's bean then use this (beanAM) in that controller.


                                To check which bean is using the desired VO:
                                I guess you have done following steps but just to clarify more I am listing steps again

                                Click on "About this page" link at the left in bottom of the page. You will see page details.
                                Click on "Expand All" link under Page Definition header; you will see all items(beans), associated VO attributes and Controllers and Application Modules attached to this page.
                                Check the Controller and Application Module for the respective item.

                                ~Mukesh U

                                Edited by: Mukesh Uchaniya on May 24, 2010 5:40 PM
                                • 13. Re: Extending controller ByrAddrCO
                                  Braj Pratap
                                  Hi very sorry quite mistake in typing the code


                                  method get root application module dont take paramater ,pls rectify the code like


                                  OAApplicationModule am = pageContext.getRootApplicationModule();

                                  OAApplicationModule childam=am.findApplicationModule("Give the AM name which is containing this VO");

                                  OAViewObject VO= (OAViewObject)childam.findViewObject("VO name") ;

                                  thanx
                                  Pratap
                                  • 14. Re: Extending controller ByrAddrCO
                                    479158
                                    Hi Pratap,

                                    public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
                                    {
                                    if(paramOAPageContext.getParameter("applyBtn") != null)
                                    {
                                    super.processFormRequest(paramOAPageContext, paramOAWebBean);

                                         OAApplicationModule am = paramOAPageContext.getRootApplicationModule();
                                         OAApplicationModule childam = am.findApplicationModule("HzPuiAddressAM"); //Line 48
                                         OAViewObject VO = (OAViewObject)childam.findViewObject("HzPuiPartySiteVO") ;

                                    I am getting the following error when i am using above

                                    Error(48,30): incompatible types; found: interface oracle.jbo.ApplicationModule, required: interface oracle.apps.fnd.framework.OAApplicationModule


                                    so, i changed the code to below, as you told in ur reply

                                    public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
                                    {
                                    if(paramOAPageContext.getParameter("applyBtn") != null)
                                    {
                                    super.processFormRequest(paramOAPageContext, paramOAWebBean);

                                    OAApplicationModule am = pageContext.getRootApplicationModule(); //Line 46
                                    //OAApplicationModule am = paramOAPageContext.getRootApplicationModule();
                                         OAApplicationModule childam = am.findApplicationModule("HzPuiAddressAM");
                                         OAViewObject VO = (OAViewObject)childam.findViewObject("HzPuiPartySiteVO") ;

                                    I am getting following error when i try the above

                                    Error(46,34): identifier pageContext not found

                                    I am very new to OAF, so i might be asking very basic questions, please bear with me :)

                                    Thanks for your time.

                                    Kiran M.
                                    1 2 Previous Next