Topic
6 replies Latest Post - ‏2013-07-10T05:01:38Z by Remya Thampi
Remya Thampi
Remya Thampi
11 Posts
ACCEPTED ANSWER

Pinned topic Redirected to generic error page while throwing an ECApplication exception from the controller command

‏2013-07-08T05:55:18Z |

Hi All,

 

I am trying to throw an ECApplication exception from my controller command, But instead of redirecting to the error view given in the exception it is throwing the below null pointer exception and redirecting to generic error page. Can somebody please help me out with this?

 

0000001f CommerceSrvr  E com.ibm.commerce.struts.BaseAction execute CMN0409E: The following error occurred during processing: "java.lang.NullPointerException".

0000001f CommerceSrvr  E ExceptionHandler convertToECException CMN0420E: The following command exception has occurred during processing: "java.lang.NullPointerException". java.lang.NullPointerException

at java.util.Hashtable.put(Hashtable.java:875)
    at com.ibm.commerce.webcontroller.WebControllerHelper.mergeProperties(WebControllerHelper.java:214)
    at com.ibm.commerce.webcontroller.AbstractErrorViewExecUnit.createInputProperties(AbstractErrorViewExecUnit.java:348)
    at com.ibm.commerce.webcontroller.AbstractErrorViewExecUnit.initializeViewProperties(AbstractErrorViewExecUnit.java:254)
    at com.ibm.commerce.webcontroller.AbstractErrorViewExecUnit.locateErrorView(AbstractErrorViewExecUnit.java:88)
    at com.ibm.commerce.struts.StrutsErrorExecUnit.<init>(StrutsErrorExecUnit.java:100)
    at com.ibm.commerce.struts.BaseAction.execute(BaseAction.java:164)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at com.ibm.commerce.struts.ECActionServlet.processRequest(ECActionServlet.java:225)
    at com.ibm.commerce.struts.ECActionServlet.doPost(ECActionServlet.java:180)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1663)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
    at com.ibm.commerce.campaigns.filter.CampaignsFilter.doFilter(CampaignsFilter.java:148)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
    at com.ibm.commerce.likeminds.filter.LikeMindsFilter.doFilter(LikeMindsFilter.java:183)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
    at com.ibm.commerce.dynacache.filter.CacheFilter$1.run(CacheFilter.java:390)
    at com.ibm.commerce.dynacache.filter.CacheFilter.doFilter(CacheFilter.java:553)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
    at com.ibm.commerce.webcontroller.RuntimeServletFilter.doFilterAction(RuntimeServletFilter.java:735)
    at com.ibm.commerce.webcontroller.RuntimeServletFilter.access$0(RuntimeServletFilter.java:545)
    at com.ibm.commerce.webcontroller.RuntimeServletFilter$1.run(RuntimeServletFilter.java:486)
    at com.ibm.commerce.webcontroller.RuntimeServletFilter.doFilter(RuntimeServletFilter.java:511)
    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
    at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
    at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:934)
    at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
    at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
    at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3944)
    at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
    at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
    at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
    at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
    at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
    at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1049)
    at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.readyInboundPostHandshake(SSLConnectionLink.java:717)
    at com.ibm.ws.ssl.channel.impl.SSLConnectionLink$MyHandshakeCompletedCallback.complete(SSLConnectionLink.java:413)
    at com.ibm.ws.ssl.channel.impl.SSLUtils.handleHandshake(SSLUtils.java:1066)
    at com.ibm.ws.ssl.channel.impl.SSLHandshakeIOCallback.complete(SSLHandshakeIOCallback.java:87)
    at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
    at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
    at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
    at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
    at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
    at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
    at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1646)
 

  • Raj.S
    Raj.S
    511 Posts
    ACCEPTED ANSWER

    Re: Redirected to generic error page while throwing an ECApplication exception from the controller command

    ‏2013-07-08T08:23:49Z  in response to Remya Thampi

    Can you please make sure that the typedProperty object set to the ECApplication() constructor is not null. If a different constructor is used, make sure that the responseProperties object is not null.

     

    Rgds, Raj.

    • Remya Thampi
      Remya Thampi
      11 Posts
      ACCEPTED ANSWER

      Re: Redirected to generic error page while throwing an ECApplication exception from the controller command

      ‏2013-07-08T08:49:30Z  in response to Raj.S

      Hi Raj,

       

      The typedProperty object set in the ECApplication is not null. It is having a key-value to hold the ErrorCode.

      Please find below my code:

      TypedProperty hshNVPs = new TypedProperty();

      hshNVPs.put("ErrorCode", "2020");
                   throw new ECApplicationException(ECMessage._ERR_CMD_INVALID_PARAM,"CLASSNAME,METHODNAME,
                          ECMessageHelper.generateMsgParms("email"),"UserRegistrationErrorView",hshNVPs);

       

      Please let me know whether anything else need to be set explicitly to the hshNVPs or responseProperties.

      • Raj.S
        Raj.S
        511 Posts
        ACCEPTED ANSWER

        Re: Redirected to generic error page while throwing an ECApplication exception from the controller command

        ‏2013-07-08T10:04:30Z  in response to Remya Thampi

        Which method are you trying to throw this exception from ?

        Can you try adding this as the first line of your method from which this exception is being thrown.

        if (null == responseProperties) {

        responseProperties = new TypedProperty ();

        }

         

        Rgds, Raj.

        • Remya Thampi
          Remya Thampi
          11 Posts
          ACCEPTED ANSWER

          Re: Redirected to generic error page while throwing an ECApplication exception from the controller command

          ‏2013-07-08T11:59:29Z  in response to Raj.S

          I am trying to throw this exception from validateParameters() method. Even after adding the above code i am getting the same exception.

           

          Regards,

          Remya

          • Raj.S
            Raj.S
            511 Posts
            ACCEPTED ANSWER

            Re: Redirected to generic error page while throwing an ECApplication exception from the controller command

            ‏2013-07-09T07:51:46Z  in response to Remya Thampi

            Probably a dumb question,

            hshNVPs.put("ErrorCode", "2020");
                         throw new ECApplicationException(ECMessage._ERR_CMD_INVALID_PARAM,"CLASSNAME,METHODNAME,
                                ECMessageHelper.generateMsgParms("email"),"UserRegistrationErrorView",hshNVPs);

             

            Is this " in the code or was it pasted by mistake ? I do not see any reason why it throws the generic error. Do you see any additional information captured in SystemErr.log ?

             

            Rgds, Raj.

            • Remya Thampi
              Remya Thampi
              11 Posts
              ACCEPTED ANSWER

              Re: Redirected to generic error page while throwing an ECApplication exception from the controller command

              ‏2013-07-10T05:01:38Z  in response to Raj.S

              Hi Raj,

              I  was able to solve the issue. The problem was the value of one of the parameters in the requestProperties was set as null and it was throwing this exception. When I fixed that the issue got resolved.

               

              Thanks for the support.

               

              Regards,

              Remya