Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4331

ConventionUnknownHandler throws null

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.15.2
    • Fix Version/s: 2.3.20
    • Component/s: Plugin - Convention
    • Labels:
      None
    • Environment:

      Tomcat 7.0.50
      Java 1.7.0_40

      Description

      ConventionUnknownHandler's handleUnknownActionMethod() always throws null which causes a NullPointerException when using the Rest-Plugin. This method is called due to RestActionMapper setting the default action method to "index" while the ConventionUnknownHandler creates an ActionSupport proxy expecting the "execute" method. Throwing null prevents the HandlerManager from handing off to the next UnknownHandler in the list, if one exists. This is related to issue WW-3368. Here's the abbreviated stack trace:

      java.lang.NullPointerException
      	org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownActionMethod(ConventionUnknownHandler.java:423)
      	com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownMethod(DefaultUnknownHandlerManager.java:96)
      	com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:437)
      	com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
      	com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)
      	org.apache.struts2.rest.RestActionInvocation.invoke(RestActionInvocation.java:138)
      

      Here's the patch:

      423c423
      < throw null;

      > return null;

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lukaszlenart Lukasz Lenart
                Reporter:
                justinjmiller justin miller
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: