Welcome to the IBM Websphere Commerce Hub

Welcome to the IBM Websphere Commerce Hub

Come join me in my journey to explore the various features and capabilities of IBM Websphere Commerce and understand how retailers can benefit from its really cool out-of-box functionality.

Monday, April 7, 2014

Debugging BOD Framework

Important Trace Strings to debug BOD

BOD Request / Response:  


Data Service Facade Trace String: 


Get Service Flow Trace Strings:

Useful to understand if the code is breaking midway and if you would like to enable tracing for individual commands.


The first point to debug the Get / Search service failures. 
The Fetch command fetches the data.Extensions of this Fetch command are associated with a particular XPath expression.The command framework can use the XPath expression and Fetch task command to resolve the Get request to a particular implementation by using the existing WebSphere Commerce command registry (CMDREG) data. Instead of having one implementation for a Fetch business task, the command framework uses the XPath as the selector to resolve the implementation. If a specific implementation is not defined for the given XPath, then a default Fetch is used.

For example , The InventoryAvailability noun uses a default Fetch implementation and to debug , you must enable the trace for :


The Fetch Command calls the Compose commands to composes the response.When the Get command calls the Compose command, it uses the access profile of the request as the key to select the appropriate Compose implementation. Because the access profile is just a superset of another access profile, the Compose commands delegates to the parent access profile to first populate the logic model and add any required information.

For example , The InventoryAvailability noun uses the below Compose implementations and to debug , you must enable the trace depending on the Inventory system used :

DOMInventorySystem com.ibm.commerce.inventory.facade.server.commands.ComposeDOMInventoryAvailabilityForDKInBatchCmdImpl



The read mediator constructs the logical object based on the values in the corresponding physical entity.The Read mediators can be found by looking at the below file:


For example , The InventoryAvailability service debugging , enable the trace for the below :
If you do not wish to enable the trace on a granular level , you could also enable the trace for the entire component service.

For example , for Inventory services , enable the below trace :

Debugging Query Template File

XPATH Syntax Validator (wcs_xpathkey utility):

The XPath key generator command-line utility takes an XPath expression as input and generates an XPath key. This key is used to locate the XPATH_TO_SQL_STATEMENT template in the query template file.This utility can help you validate the format of the XPATH Key as well such as missing closing brackets etc or misplaced tokens. Please note this would not however match the XPATH with the actual Noun definition.

wcs_xpathkey MyXPath
For example:
wcs_xpathkey /CatalogEntry[(@catalogEntryTypeCode='ProductBean' 
  or @catalogEntryTypeCode='ItemBean') and 
   ParentCatalogGroupIdentifier[ExternalIdentifier[GroupIdentifier='Coffee Table']]]

The output from this command , if sucessful, would be:
/CatalogEntry[(@catalogEntryTypeCode=) and 

In case of failures , would display certain error messages.

Query Template File Syntax Validator

Use this page to validate your query template file syntax.

In case you are seeing NullPointer exceptions on querying even the OOB services, make the below changes in the dsl.jsp.

Search for the below line:

Add the following line of code below the above line:

Reloading the configuration of a BOD service module

During development, you may want to modify and reload configuration, without having to restart the server. Follow the below Infocenter link  for more details: