Saturday, August 29, 2015

Dialog Activity Issue in Websphere Commerce

If we face the Issue When we configure the following dialog activity in wcs.

Birthday Trigger

Customer Places the Order 

Order History

  1. Enable the following marketing listeners: the SensorEventListener and ExperimentEvaluationEventListener. These listeners must be enabled to support some behavioral marketing features and to gather marketing statistics for marketing experiments:
    1. Find the following string in wc-server.xml:
      compClassName="com.ibm.commerce.marketing.dialog.trigger.SensorEventListener"
    2. Below the string, ensure that the enable attribute is set to true, as shown in the following example:
      <component
          compClassName="com.ibm.commerce.marketing.dialog.trigger.SensorEventListener"
          enable="true" name="SensorEventListener">
          <property display="false">
              <start enabled="true"/>
          </property>
      </component>
    3. Find the following string in wc-server.xml:
      compClassName="com.ibm.commerce.marketingcenter.events.runtime.ExperimentEvaluationECEventListenerImpl"
    4. Below the string, ensure that the enable attribute is set to true, as shown in the following example:
      <component
          compClassName="com.ibm.commerce.marketingcenter.events.runtime.ExperimentEvaluationECEventListenerImpl"
          enable="true" name="Experiment Evaluation Event Listener">
          <property display="false">
              <start enabled="true"/>
          </property>
      </component>
  2. Restart the server
  3. Make sure the SendMarketingTriggers scheduler configured in site level.
  4. When you create a dialog activity, please make the all the component available in the activity (Target, trigger,action).

Web services error in WebSphere commerce.

Error:

ConnectionEve A   J2CA0056I: The Connection Manager received a fatal connection error from the Resource Adaptor for resource eis/JCAHTTP-WS.  The exception which was received is java.io.IOException: javax.xml.soap.SOAPException: org.xml.sax.SAXParseException: The root element is required in a well-formed document. Message being parsed:

                at com.ibm.ws.webservices.engine.SOAPPart.getEnvelope(SOAPPart.java:639)


Solution: 


This issue is because of the SOAPAction parameter got missing in the SOAPHeader,So please apply the following fix for solve the issue.


1)      Close your toolkit and stop server
2)      Follow the steps mentioned in the link - http://www-01.ibm.com/support/docview.wss?uid=swg21297330  (install attached APAR)
3)      Make sure you follow the changes step mentioned for change wc-server.xml (adding entry for SOAPAction)
4)      Restart the server and login into admin console
              5)     For the message type – com.mycompany.commerce.services, set the SOAPAction as mentioned                          in the WSDL

Can customer have multiple pending order in Websphere Commerce server

Yes, It can.

In the OrderItemAddCmd, If we are passing the orderId parameter value as "."(dot) in the request , then it will create a new order, if the customer doesn't has any pending order

Or it will add the item to existing pending order.

 And If the orderId parameter value as "**" then it will always create as a new pending order.





Websphere commerce Interview Questions

1.Contoller Command and Task Command differences

2.Organization data model

3.Calculation Framework, How to add new calusage ids

4.Payment model (tables and commands)

Exception details from the WebSphere Commerce search handlers

Problem

There is missing information in the exception details for an invalid langId parameter from the WebSphere Commerce search handlers.
For example, you might receive the following error:
{"errors":[{"errorCode":"CWXFR0230E","errorKey":"ERR_INTERNAL_SERVER_ERROR","errorLevel":"SEVERE","errorMessage":
"CWXFR0230E: Internal server error. Details will be stored within the server logs."}]}

Solution

This error message occurs for an invalid langId parameter from the WebSphere Commerce search handlers.
The error message is a known issue, where it does not indicate specific problems with the parameter, and instead returns an internal server error.
To avoid this issue, ensure that you pass a valid langId value for the WebSphere Commerce search handlers.

Pass custom parameter to OrderItemAddCmd in FEB 8

In FEB 8, They are calling all the controller command as rest. So If you want to pass any custom parameter to the OrderItemAddCmd, we don't need to customize the order facade client. In the previous version we had done that way.

Please follow the steps:

1. The Request parameter mapping for all the rest commands is in this template file "\Stores\WebContent\WEB-INF\config\com.ibm.commerce.order-fep\rest-template-config.xml"

 So please add your custom entry as "x_warrenty."
2.Pass the custom param with the request "warrenty".

3.Then extend the OrderItemAddCmd then do the bussiness logic.

Send Immediate issue for SendMsgCmd in Websphere Commerce Server.

If we are using SendMsgCmd for triggering the email, the email will take 5 minutes delay, Because In WCS has message pool concept.When the SendMsgCmd is getting call it will send the msg into pool then the scheduler command SendTransactedMsg cmd will pick all the messages from Pool then send it to the appropriate account.

For avoiding that delay, We can use sendImmediate() method, but sometime this may cause the issue for thread hung. So if that is happened then we can't move out from the page. for avoid those kind of issue use the below logic.

1. In the SendMsgCmd use sendTransacted() then after that, call the SendTransactedMsg scheduler job immediately  by using the below code.

String strPasswordNotifyName = "PasswordNotify";
            SendMsgCmd cmdSendMsg = (SendMsgCmd)CommandFactory.createCommand("com.ibm.commerce.messaging.commands.SendMsgCmd", getStoreId());
            cmdSendMsg.setMsgType("PasswordNotify");
            cmdSendMsg.setStoreID(getStoreId());
            Messaging ms = new Messaging("PasswordNotify", getStoreId());
            String strMsgSubjectKey = ms.getUserData(null, "subject_key");
            String strSubject = buildMessageSubject(strMsgSubjectKey);
            if(strSubject != null)
                cmdSendMsg.setConfigData("subject", strSubject);
            cmdSendMsg.addMember(getUsersId());
            TypedProperty hshTypedProperty = new TypedProperty();
            hshTypedProperty.put("logonId", getLogonId());
            hshTypedProperty.put("logonPassword", getPassword());
            CommandContext ccc = (CommandContext)getCommandContext().clone();
            cmdSendMsg.compose(null, ccc, hshTypedProperty);
            cmdSendMsg.sendTransacted();
            cmdSendMsg.setCommandContext(ccc);
            cmdSendMsg.setStoreID(ccc.getStoreId());
            cmdSendMsg.execute();
           
            LOGGER.logp(Level.INFO, CLASSNAME, methodName, "Message parameters set for Password Reset email - Add job command being invoked");
            AddJobCmd addJob = (AddJobCmd) CommandFactory.createCommand(AddJobCmd.NAME, getStoreId());
            addJob.setCommandContext(getCommandContext());
            addJob.setPathInfo("SendTransactedMsg");
            addJob.setName("wcsadmin");
            addJob.setStartTime(new Timestamp(System.currentTimeMillis() + 5));
            addJob.setUrl("/");
            addJob.setAccCheck(false);
            addJob.execute();
            LOGGER.logp(Level.INFO, CLASSNAME, methodName, " Add job command being execution complete");



Debug the Promotion module in WebSphere Commerce server


  1. Promotion module
  • Enable the following runtime trace string in WAS console:
    • com.ibm.websphere.commerce.WC_ORDER=all: com.ibm.websphere.commerce.WC_CALCULATION=all: com.ibm.commerce.marketing.promotion.*=all: com.ibm.commerce.promotion.*=all



   2.Enable the debug mode for promotion in Websphere Commerce server.
      
    Please change the following line in the file                           "WC_installdir/instance_name/xml/PromotionEngine/WCSPromotionEngineConfig.xml"

Change the debug tag value from false to true.Then it will log more information in console.

<debug>true</debug>

 

Enabling Dynamic Cache Monitor in WebSphere Commerce Developer



1.       Import C:\RAD75\SDP\runtimes\base_v7\installableApps\cachemonitor.ear using RAD import EAR facility into project named CacheMonitor




2.       Click Next


3.       Click Next


4.       ClickFinish
5.       Open CacheMonitor_Web/WebContent/WEB-INF/ibm-web-bnd.xmi, and edit the file as stated below -
-    locate the virtualHostName attribute and change it from default_host to WC_default_host

6.       OpenC:\WCDE_ENT70\wasprofile\config\cells\localhost\nodes\localhost\servers\server1\server.xml to enable Dynacache
-          Find the following line and setenableServletCaching="true"
<components xmi:type="applicationserver.webcontainer:WebContainer" xmi:id="WebContainer_1" enableServletCaching="true" >

7.       Right click on WebSphere Commerce Test Server, select Add and remove projects. Add CacheMonitor project to the Configured projects on test server.

8.       Right click WebSphere Commerce Test Server,clickPublish.

You should be able to access your cachemonitor using the following URL:
https://localhost:8002/cachemonitor/