Troubleshooting: Transaction server error after struts 2 migration

After you migrate your local store to Struts 2 you might see an error in the Transaction server log similar to StrutsViewExecUnit StrutsViewExecUnit CMN0203E: Command not found. You can resolve this error using one of the default Struts actions.

Problem

You store could have problems with some Struts views after upgrading to Struts 2. For example, duplicating a requisition list in your B2B store is not working properly, and in the Transaction server log, you can see the entry CommerceSrvr  A StrutsViewExecUnit StrutsViewExecUnit CMN0203E: Command not found: "RequisitionListsView".

Solution

In Struts 2, the action parameter in a child package does not inherit the action in its parent package. To fix this problem, copy the action from the default Struts configuration files to struts-wcs-store-custom.xml and merge the parameters in the action definition. The following example uses RequisitionListsView.
  1. Search for the string RequisitionListsView in the Transaction server's Stores.war directory. You will override the RequisitionListsView in the struts-wcs-stores-custom.xml.
    In this example, the parameter is found to look like the following in struts-wcs-stores-custom.xml:
            <action class="com.ibm.commerce.struts.v2.BaseAction" name="RequisitionListsView">
                     <param name="https">0:1</param>
               </action>
    
    In struts-wcs-stores-widgets.xml, however, it looks like this:
              <action class="com.ibm.commerce.struts.v2.BaseAction" name="RequisitionListsView">
                    <param name="credentialsAccepted">0:P</param>
                     <result name="RequisitionListsView">
                            <param name="location">/Widgets_701/com.ibm.commerce.store.widgets.RequisitionLists/RequisitionListsAjax.jsp</param>
                           <param name="properties">storeDir=no</param>
                      </result>
                </action>
  2. Copy the action from struts-wcs-stores-widgets.xml to struts-wcs-stores-custom.xml, which now contains:
              <action class="com.ibm.commerce.struts.v2.BaseAction" name="RequisitionListsView">
                    <param name="https">0:1</param>
                     <param name="credentialsAccepted">0:P</param>
                     <result name="RequisitionListsView">
                            <param name="location">/Widgets_701/com.ibm.commerce.store.widgets.RequisitionLists/RequisitionListsAjax.jsp</param>
                           <param name="properties">storeDir=no</param>
                      </result>
                </action> 
    
  3. Deploy the Stores project and restart the Transaction server.
Note: If you encounter similar problems with other Struts action views, check and merge their parameters manually.