Friday, March 13, 2015

Websphere MQ with IBM WCS

  1. Run setup.exe to install MQ
  2. In the Field for the Queue Manager name – Type in QM_{$Computer_Name}
    ** This can also be any significant name
    To get Compute Name – Goto Start -> My Computer -> Right Click - > Properties -> Tab to Computer Name

    Do NOT Join the Queue Manager to the Default Cluster.


  3. Once installed, To Test if the listener is running.

    Start -> run -> cmd

    > netstat -an | find "1414"
      TCP    0.0.0.0:1414           0.0.0.0:0              LISTENING

Configuring WebSphere MQ for use with WebSphere Commerce :


Once the Queue Manager has been created.  Queues also need to be added.
Right Click on Queues - > Create New
Created a queue for each of the following

Queue
Description
hostname.error
Default error queue. Collects erratic inbound messages.
hostname.inbound
Used by SendReceiveImmediate mode of the adapter for WebSphere MQ. It is where the reply and response messages from the backend system should go. WebSphere Commerce can optionally pick reply and response messages based on an outgoing request to a backend system.
hostname.inboundp
Any message arrive at this queue will be processed in parallel manner.
hostname.inbounds
Any message arrive at this queue will be processed in serial manner based on the message delivery sequence option of the queue.
hostname.outbound
Used for WebSphere Commerce initiated outbound messages and reply messages from WebSphere Commerce.






Add the Environment Variables
Start -> My Computer -> Right Click -> Advanced -> Environment Variables ->
MQSERVER
CLIENT.QM_<Hostname>


 Configuring WebSphere Application Server for use with WebSphere MQ

  1. Start the default WebSphere Application Server application server (server1).
D:\IBM\WCDE_ENT70_Comet\bin>startWCServer.bat
  1. Open the WebSphere Application Server Administrative Console.
http://localhost:9060/ibm/console
  1. Log on to the WebSphere Application Server Administrative Console.
wasadmin
  1. In the navigation tree, expand Environment and select WebSphere Variables. Enter the MQ_INSTALL_ROOT value:
 Click MQ_INSTALL_ROOT.



Value

C:\IBM\WebSphereMQ (OR) ${C:\Program Files (x86)\IBM\WebSphere MQ
(path in which websphere MQ is installed)

This changes mostly stored at : Document cells/localhost/nodes/localhost/variables.xml is modified.
5. Click OK.
6. Click Save in the Administrative Console task bar.
7. On the Save page, select Synchronize changes with node.
8. On the Save page, click Save.
9. Close the WebSphere Application Server Administrative Console.

Setting Native Lib Paths

Open the WebSphere Application Server Administrative Console. Log on to the WebSphere Application Server Administrative Console. Enable the ActivitySession service.
Expand Servers > Server Types. Click WebSphere Application Servers.
Click server1.
Under Container Settings, expand Business Process Services.
Click the ActivitySession service.
Select Enable service at server startup.
Click OK and save the configuration.

Click on Resourses - > JMS -> JMS Providers
And set the java lib path in native lib paths area
For Eg. (C:\Program Files (x86)\ibm\WebSphere MQ\java\lib64)

Determining the maximum number of connections allowed for the Adapter for WebSphere MQ

In the WebSphere Application Server Administrative Console navigation tree, expand Applications > Application Types and select WebSphere enterprise applications.
In the list of enterprise applications, click WC
Under Modules, click Manage Modules.
In the list of connector modules, click Adapter for WebSphere MQ. The Enablement-JCAJMSConnector.rar page displays. 
In the Additional Properties section on the Enablement-JCAJMSConnector.rar page, click Resource Adapter. The WC.Adapter for WebSphere MQ page displays,
In the Additional Properties section of the WC.Adapter for WebSphere MQ page, click J2C Connection Factories. The J2C Connection Factories page displays.
In the list of J2C Connection Factories, click Enablement-JCAJMSConnector.rar. The Enablement-JCAJMSConnector.rar page displays.
In the Additional Properties section on the javax.resource.cci.ConnectionFactory page, click Connection Pool Properties. The Connection Pools page displays.
Enterprise Applications > WC > Manage Modules > Enablement-JCAJMSConnector.rar > WC.Adapter for WebSphere MQ > J2C connection factories > javax.resource.cci.ConnectionFactory > Connection pools

Take note of the value in the Max connections field. This value will be required in Creating a WebSphere MQ messaging provider queue connection factory.
Max Connections: 10

Creating a WebSphere MQ messaging provider queue connection factory


1. In the WebSphere Application Server Administrative Console navigation tree, expand Resources and select JMS then Queue connection factories.
2. Select the scope of the queue connection factory from the list. It is recommended to create it under the scope of Node=WC_instance name_node, Server=server1 level.
3. Click New.
4. Select WebSphere MQ messaging provider and click OK. 


Configure basic attributes with the following values:
In the WebSphere Application Server Administrative Console navigation tree, expand Resources and select JMS then Queue connection factories.
Click New. 
Select WebSphere MQ messaging provider and click OK. 
Configure basic attributes with the following values:


Option
Description
       Name
       JMSQueueConnectionFactory
       JNDI Name                                             
       JMSQueueConnectionFactory
      Optional: Description
       JMSQueueConnectionFactory

Click Next
Enter the Queue Manager Name as appears in MQ Messaging

Click Next
In Enter Connection Details -> Select Bindings
Test Connection -> Summary -> Finished.


In the WebSphere Application Server Administrative Console navigation tree, expand Resources and select JMS then Queues

JMS queue to WebSphere MQ queue mappings



JMS queue
   WebSphere MQ queue
Target Client
      JMSSerialInboundQueue
      hostname.inbounds
        JMS
     JMSParallelInboundQueue
     hostname.inboundp
        JMS
     JMSInboundQueue
     hostname.inbound
        JMS
     JMSOutboundQueue
     hostname.outbound
        MQ
     JMSErrorQueue
     hostname.error
       MQ


Configuring WebSphere Commerce to use WebSphere MQ


In Info Center there is a step
To do this in Developer update the wc-server.xml
c:\IBM\WCDE_ENT70_Comet\workspace\WC\xml\config\ wc-server.xml

   <component
      compClassName="com.ibm.commerce.messaging.listener.TransportAdapter"
      enable="true" name="Listener for WebSphere MQ (TransportAdapter)">
      <property display="false">
        <tmpInboundConnectorFile filename="some transport xml file name - temporary"/>
      </property>
    </component>


Once this is updated, restart the server.


Testing WebSphere MQ configuration

To test your WebSphere MQ configuration, insert the following message in the hostname.inbounds message queue
Procedure
Open the WebSphere MQ Explorer according the instructions in the WebSphere MQ documentation.
Right-click hostname.inbounds and select Put Test Message from the pop-up menu.
In the test message window, enter the following text: <?xml test message> .
WebSphere MQ is configured properly if the following occurs:
The test message is consumed from the serial inbound queue (hostname.inbounds).
An error message appears in the hostname.outbound queue.
The original message appears in the hostname.error queue.


Wednesday, February 25, 2015

java.lang.UnsatisfiedLinkError - mqjbnd.dll is not a valid Win32 application

 java.lang.UnsatisfiedLinkError - mqjbnd.dll is not a valid Win32 application


Issue : java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\IBM\WebSphere MQ\java\lib64\mqjbnd.dll (C:\Program Files (x86)\IBM\WebSphere MQ\java\lib64\mqjbnd.dll is not a valid Win32 application


Resolution : MOstly it happens due to system os is of 64bit and wcs is installed for 32bit.

Change library location to C:\Program Files (x86)\IBM\WebSphere MQ\java\lib\mqjbnd.dll

Thursday, February 19, 2015

Data import process was unsuccessful

Solr indexing with remote DB

Issue : Data import process was unsuccessful. An unrecoverable error has occurred.


Then I increased timeout :

C:\WCDE_ENT70\bin> di-buildindex.bat -masterCatalogId 10001 -solrConnTimeout 20000

Then I got:
org.apache.solr.client.solrj.SolrServerException: java.net.ConnectException: Connection refused: connect

SOLUTION:

Connection setting in DB for SOLR was wrong in remote DB ( which is running in Linux)
I have to update the tables SRCHCONF and SRCHCONFEXT to point it to local toolkit server.

update SRCHCONF set config='IndexScopeTag=0,SearchServerPort=80,SearchServerName=localhost,PreProcessConfigDirectory=C:\WCDE_E~1\search\pre-processConfig\MC_10001\DB2' where indextype='CatalogEntry';

update SRCHCONF set config='IndexScopeTag=1,SearchServerPort=80,SearchServerName=localhost,PreProcessConfigDirectory=C:\WCDE_E~1\search\pre-processConfig\MC_10001\DB2\CatalogGroup' where indextype='CatalogGroup';

update SRCHCONFEXT set config ='SearchServerPort=80,SearchServerName=localhost';


Restarted server and it worked. 


Server and port names should match with workspace\WC\xml\config\com.ibm.commerce.catalog-fep\wc-search.xml

Wednesday, February 4, 2015

Customizing the agenda builder

       Customizing the agenda builder
Agenda builder in ibm wcs is If you want to change the default logic that selects potentially applicable promotions for evaluation, or to improve system performance by screening promotions prior to evaluation to reduce the number of promotions to be evaluated at runtime.A WebSphere Commerce instance has only one agenda builder. Customizations apply to all stores in the same instance.The agenda builder searches promotions directly related to shopping cart content rather than all available promotions in the system.This implementation requires data populated in the CATENCALCD, and CATGPCALCD table during the promotion authoring process that indicates the mapping between promotion and catlogEntry or category.If the store rarely has category-level promotions, then a flag can be set in the promotion engine configuration file for the agenda builder. The name of the flag is PerformCheckForCategoryLevelPromotions and it may have a value of true or false. If the flag is set to true, then a search is performed for any active category-level promotions in the store.

Customization steps:
1. Implement agenda builder. 
The only requirement is that your agenda builder must implement the com.ibm.commerce.marketing.promotion.runtime.PromotionExecutionAgendaBuilder interface. This interface is also a subclass of XMLizable interface. As a result, you must define the toXML and fromXML methods for your implementation, as well as a serialized XML form for your agenda builder.

2. Register the custom agenda builder in the promotion engine configuration.

1.         Edit the promotion engine configuration XML file in an editor. You can find this file in the following location:WC_eardir/xml/PromotionEngineConfiguration/WCSPromotionEngineConfig.xml
2.         Update the following code segment:
3.         <PromotionExecutionAgendaBuilder impl="
com.ibm.commerce.marketing.promotion.runtime.DefaultAgendaBuilder">
The segment in bold should be updated to reflect either the custom agenda builder, or one of the following agenda builders:
StorePathSupportedAgendaBuilder
This is the default agenda builder. It supports all of the WebSphere Commerce features and business models. To select this agenda builder, set the PromotionExecutionAgendaBuilder's impl parameter to:
com.ibm.commerce.marketing.promotion.runtime.StorePathSupportedAgendaBuilder
CodeDrivenAgendaBuilder
This agenda builder only builds a PromotionExecutionAgenda for promotions for which a promotion code is entered by a customer. To select this sequence builder, set the PromotionExecutionAgendaBuilder's impl parameter to:
com.ibm.commerce.marketing.promotion.runtime.CodeDrivenAgendaBuilder
DefaultAgendaBuilder
A former default agenda builder that does not support B2B business models. To select this sequence builder, set the PromotionExecutionAgendaBuilder's impl parameter to:
com.ibm.commerce.marketing.promotion.runtime.DefaultAgendaBuilder
ShopcartDrivenAgendaBuilder
This agenda builder searches for product-level promotions in the "ProductLevelPromotion" group that are directly related to the contents of the customers shopping cart, rather than searching all defined promotions. This agenda builder satisfies retail store check-out process requirements, which evaluate the promotions each time a product gets scanned. Therefore, it significantly decreases evaluation time. Other promotion groups, such as order-level promotions, still follow the default procedure.
This builder requires some predefined customer-based search algorithms for product-level promotions. The algorithm depends on the relationship between products and promotions in your store. This builder provides a WebSphere-Commerce-specific search algorithm, which uses a set of calculation-code-related tables, CATENCALCD and CATGPCALCD. To select this agenda builder, set the PromotionExecutionAgendaBuilder's impl parameter to:
com.ibm.commerce.marketing.promotion.runtime.ShopcartDrivenAgendaBuilder
You may also see the following agenda builder, which is not intended to be used directly:
PromotionExecutionAgendaBuilder
A dummy interface to facilitate customization. Any custom agenda builders must call this interface.
4.         Publish the updated configuration file to the production server
5.         Restart WebSphere Commerce. Since the agenda builder is initialized during WebSphere Commerce start up, a restart is required before the changes take effect.

Tuesday, February 3, 2015

websphere commerce useful urls

websphere commerce useful urls

Managment center (CMC): Out of the box user id password for admin wcsadmin/wcsadmin
https://localhost:8000/lobtools

Accelerator:
https://localhost:8000/webapp/wcs/tools/servlet/ToolsLogon?XMLFile=common.mcLogon&storeId=0

Admin Console:
https://localhost:8002/webapp/wcs/admin/servlet/ToolsLogon?XMLFile=adminconsole.AdminConsoleLogon&storeId=0


Org Admin Console:
https://localhost:8004/webapp/wcs/orgadmin/servlet/ToolsLogon?XMLFile=buyerconsole.BuyAdminConsoleLogon&storeId=0

Dynacache:
https://localhost:9043/cachemonitor/

WasAdminConsole:
    http://yourserver:9060/ibm/console or https://yourserver:9043/ibm/console

Start DM: Location:  /opt/IBM/WebSphere/AppServer/bin
./startManager.sh

Start Node Agent:
./startNode.sh -profileName
e.g. ./startNode.sh -profileName LIVE

SearchIndexSetup:
cd C:\WCDE_ENT70\components\foundation\subcomponents\search\bin
setupSearchIndex.bat -masterCatalogId 10001 -dbuser db2admin -dbuserpwd

PreProcessing: \bin
di-preprocess.bat C:\WCDE_ENT70\search\pre-processConfig\MC_10001\DB2\

Start server and run BuildIndex: \bin
di-buildindex.bat -masterCatalogId 10001

Validating build indexes:
http://localhost/solr/MC_10001_CatalogEntry_en_US/select?q=*

Validating build index for a catentryId:
http://localhost/solr/MC_10001_CatalogEntry_en_US/select?q=catentry_id:10086

SOLR home:
TOOLKIT_HOME\search\solr\home

SOLR web interface Console:
http://localhost:8080/solr/admin/index.js

ScheduleJob --->SOLRLoadCmd
Parameters: storeId=10054&catalogId=10001&langId=-1

Nifstack.xml:
Toolkit path: \properties\version\update\backup
Server path: /opt/IBM/WebSphere/CommerceServer60/properties/version/update/backup/NIFStack.xml

wc-server.xml:
Toolkit path: \xml\config\wc-server.xml
Commerce V7: \workspace\WC\xml\config

Local DB access:
http://localhost/webapp/wcs/admin/servlet/db.jsp

Server path: /opt/IBM/WebSphere/AppServer/profiles//installedApps/WC__cell/WC_.ear/xml/config
instance name would need to be replaced with the node name.

Friday, January 9, 2015

Performance analysis in IBM WCS

By using WebSphere Application Server Performance Monitoring Infrastructure (PMI) we can  monitor the performance of our WebSphere Commerce system. The WebSphere Commerce application server gathers statistics for URLs, tasks, and views. Each data key has an associated set of counters that provide information. For example, the average response time of a task, maximum and minimum response times, and the total number of times a task was called.

 Steps to enable WCS Performance module


Step 1
Enable WCS Performance module.
Edit WCDE_ENT70\workspace\WC\xml\config\wc-server.xml and ensure enabled="true" for following entry

<component compClassName="com.ibm.commerce.performance.monitor.PerfMonitor"   enable="true" name="PerfMonitor"/>

Step 2
Restart server
Open WAS console :















Select Server1 Under this check -
1.Select the Enable Performance Monitoring Infrastructure (PMI) check box.
2.Save and apply the change.
















Now under monitoring and tuning - under performance viewer --> In current activity --> Select server1 and click on start monitoring.

By default Performance module for commerce is disabled, as shown in the screenshot below.









Follow this step to enable the module, select options as shown by the markers in the screen shot below.











 After selecting the custom option, now make selections as indicated by markers on the screenshot.











Now run the Tivoli performance viewer and collect statistics real time.











After some time you should be able to see the performance stats being plotted real time on the graph.
























Using same steps we can enable other stats aswell.
Refrence :WCS PMI Module, WebSphere Commerce PMI module performance monitoring

Monday, January 5, 2015

Websphere Profile name is invalid Specify a profile name that exists on the server


Issue : After a project is added to the server, the WebSphere profile name field cannot be changed.

Resolving the problem

To modify the WebSphere profile name field in the server editor:
In the Servers view, right-click the WebSphere Application Server entry and select Add and remove projects.
Select the Remove All button.
Click Finish in the Add and remove projects wizard and allow for the changes to occur on the server.
Open the server editor by right-clicking the WebSphere Application Server entry in the Servers view and select Open.

Under the Server section, you can now select a valid and existing profile from the WebSphere profile name drop-down list (Go to Step 9 if there are no profiles available).
Save the changes in the server editor by typing Ctrl + s.
In the Servers view, right-click the WebSphere Application Server entry and select Add and remove projects.
Click Add All > Finish.
If there are no profiles available, you can create a new one using the Profile Management Tool:
First close the server editor
Select Windows > Preferences and click on the Server > WebSphere Application Server page.
 Select the server you want to create a profile for and click the Run Profile Management Tool button.
Open the server editor and you should see the new profile.

Refrence : Unable to edit the WebSphere profile name field after a publish failure using an invalid profile