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.