Tuesday, 18 March 2014

Error on executing versionInfo.bat


Unable to run versionInfo.bat  ? similar error as below.



C:\IBM\WCDE_ENT70\bin>versionInfo.bat
WVER0010I: Copyright (c) IBM Corporation 2002, 2005; All rights reserved.
WVER0011I: WebSphere Application Server Release 6.0
WVER0012I: VersionInfo reporter version 1.15.3.4, dated 11/12/08

--------------------------------------------------------------------------------
IBM WebSphere Application Server Product Installation Status Report
--------------------------------------------------------------------------------

Report at date and time 2014-03-05 11:55:48+0530

Installation
--------------------------------------------------------------------------------
Product Directory C:\IBM\WCDE_E~1
Version Directory C:\IBM\WCDE_E~1\properties\version
DTD Directory C:\IBM\WCDE_E~1\properties\version\dtd
Log Directory C:\IBM\WCDE_E~1\logs
Backup Directory C:\IBM\WCDE_E~1\properties\version\update\backup
TMP Directory C:\Users\ADMINI~1\AppData\Local\Temp
java.lang.NullPointerException
        at com.ibm.websphere.product.WASProduct.loadVersionInfo(WASProduct.java:2214)
        at com.ibm.websphere.product.WASProduct.getVersionInfo(WASProduct.java:2143)
        at com.ibm.websphere.product.WASProduct.getPlatform(WASProduct.java:968)
        at com.ibm.websphere.product.VersionInfo.printReport(VersionInfo.java:1091)
        at com.ibm.websphere.product.VersionInfo.runReport(VersionInfo.java:870)
        at com.ibm.websphere.product.VersionInfo.runReport(VersionInfo.java:802)
        at com.ibm.websphere.product.VersionInfo.runReport(VersionInfo.java:737)
        at com.ibm.websphere.product.VersionInfo.main(VersionInfo.java:468)
        at com.ibm.websphere.product.VersionInfo.main(VersionInfo.java:300)
        at com.ibm.commerce.install.internal.utils.WCVersionInfo.main(WCVersionInfo.java:56
WVER0004E: Error writing version report to Standard Output: java.lang.NullPointerException



 Somehow you have managed to get the contents of the below folder to be deleted.
C:\IBM\WCDE_ENT70\properties\version\.. . 

This is where websphere commerce will refer to inorder to figure out the current status of the product installation. 

Details of the current version installed are contained in the NIFStack .

C:\IBM\WCDE_ENT70\properties\version\update\backup\NIFStack.xml 

It containes info on the apars installed , current Fixpack level , feature pack level , history , product ids etc.

Solution:
Try to copy the entire properties folder from a colleague who has installed the product with similar settings and is at the same fixpack and featurepack level as you are on. I am not sure there is another way.

Do not proceed with apars installation or any other upgradation until you fix this NIFStack.xml issue. 

How to escalate a Credit card/ Banking Dispute

There are many instances when you are lured by a customer service executive into signing up for a credit card / opening a bank account on the promise of a few goodies.

But most of these too good to be true schemes end up with the bank creating problems either by charging some a fee under a miscellaneous  column.

It gets worse when the call center does not help.

The best way out is to complain to the RBI ombudsman.

https: //secweb.rbi.org.in/BO/precompltindex.htm

Wednesday, 12 March 2014

Start and Stop Hybris Server. & Server Console Logs.

I could not find this in the documentation.unfortunately. Its Pretty basic though.

This is how one can start and stop the Hybris server instead of killing the process in the task manager :-) or doing a Ctrl +C and then Y  . on the Console.

On Command Prompt .. Navigate to  Installation Directory . viz. E:hybris\bin\platform

The following arguments can be passed to hybrisserver.bat .

catalina.bat [hybris mode]
Usage:  catalina.bat ( commands ... )
commands:
  run               Start Tomcat in the current window
  start             Start Tomcat as windows service
  stop              Stop Catalina

At Cmd prompt

to Start : >hybrisserver.bat -start    ( Start as a Windows Service ) .In This case You will need to seperately open the Logs.

to Stop  : >hybrisserver.bat -stop

Console Logs Path .

E:\hybris\log\tomcat\console-20140312.txt   ( Wierd that it is a text file  and not a .log file )

It is impossible to debug Hybris looking at logs in the console.

Sunday, 2 March 2014

Getting Started with Hybris.

It was Quite Difficult to get my hands on the Hybris software and finally the documentation was lacking so very much  and I could hardly find any help available .googling..

Registering on the Hybris site is a big pain.  You have to wait months until  receive an approval e-Mail. I guess this is to keep most people out.
So you will have to either get it from a friend , who already has it , or wait it out ..

Once you have downloaded the  hybris-commerce-suite  .
Follow the steps mentioned in the wiki.
The extracted folder will have something like below. 



Navigate to <Directory of installation> :\..\hybris\bin\platform  , and run setantenv.bat  .
Ignore any warnings.

Run the ant build .   cmd -> ant clean all . ( This takes a bit of time . )

Now you can start the Hybris Server. 

Run the Hybris Server.  hybrisserver.bat . 

Error : 
Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine 



In case you end up with this error.
Navigate to <directory>:\..\hybris\bin\platform\tomcat\conf   and update the 

xMx -  maximum size of the memory allocation pool and 
XX:MaxPermSize  - initial size that will be allocated during startup of the JVM

 Here is what I have configured. 

wrapper.java.additional.1=-Xmx1G
wrapper.java.additional.2=-XX:MaxPermSize=512M  


Hope this helps. 

Once the Server is Up . 


Server Admin Console ( Hybris Admin Console )  : http://localhost:9001/ 

Id/ Pass : admin/nimda . 

CMS Manager : cmsmanager/1234   - http://localhost:9001/cmscockpit/login.zul


 There you go on with checking out Hybris. 

Features and Options Seems very less compared to Websphere Commerce , but then again this is still evolving. 
 

Monday, 6 January 2014

Building Search Indexes in Websphere Commerce


Websphere commerce has been providing apache solr  embedded on the WAS server as aembedded search engine with the WCS e-commerce solution.
Websphere Commerce Search Engine was started as a part of Feature Pack 2.
  • WebSphere Commerce Version 7 Feature Pack 2
  • Websphere Commerce Version 7 Feature Pack 3  
  Enablement of the Search Feature .
Incase the Feature was not enabled as a part of the Feature Pack installation, the same can be enabled by doing the following.
 enableFeature.bat -DfeatureName=foundation [-DsolrHome=solrhome]



Setting up the solr Search locally .
  1. Navigate to the following directory:
 Run the search index setup utility:
setupSearchIndex.bat -action action-masterCatalogId masterCatalogId [-indextype indextype] [-solrhome solrhome][-setupWebContent true | false] [-indexsubtype indexsubtype]

setupSearchIndex.bat -action action-masterCatalogId masterCatalogId [-indextype indextype] [-solrhome solrhome][-setupWebContent true | false] [-indexsubtype indexsubtype]

setupSearchIndex.bat -masterCatalogId masterCatalogId  ( This will suffice on a Local Developer Machine ).

Sample Logs
=================================================================
WebSphere Commerce Search Index Setup Utility
=================================================================

Utility started at 2013-09-20 12:30:32
Configuration initialization started at 2013-09-20 12:30:32
Configuration initialization finished at 2013-09-20 12:30:33
Database initialization started at 2013-09-20 12:30:33
Database initialization finished at 2013-09-20 12:30:34
Initialization completed in 2.332 seconds.
Build and execute process job started at 2013-09-20 12:30:34


**************************************************************
Started configuring WebSphere Commerce for Solr cores
**************************************************************
Master Catalog Id: 10051
Index Type: CatalogEntry
Languages: [en_US, fr_FR, de_DE, it_IT, es_ES, pt_BR, zh_CN, zh_TW, ru_RU, ko_
, ja_JP, ro_RO, pl_PL]
**************************************************************

--- Started configuring pre-process. ---
--- Finished configuring pre-process. ---

--- Started configuring attribute dictionary. ---
--- Finished configuring attribute dictionary. ---

--- Started configuring classic attribute. ---
--- Finished configuring classic attribute. ---

--- Started configuring delta update. ---
--- Finished configuring delta update. ---

--- Started configuring wc-search.xml. ---
--- Finished configuring wc-search.xml. ---


**************************************************************
Finished configuring WebSphere Commerce for Solr cores
**************************************************************




**************************************************************
Started configuring WebSphere Commerce for Solr cores
**************************************************************
Master Catalog Id: 10051
Index Type: CatalogGroup
Languages: [en_US, fr_FR, de_DE, it_IT, es_ES, pt_BR, zh_CN, zh_TW, ru_RU, ko_
, ja_JP, ro_RO, pl_PL]
**************************************************************

--- Started configuring pre-process. ---
--- Finished configuring pre-process. ---

--- Started configuring delta update. ---
--- Finished configuring delta update. ---

--- Started configuring wc-search.xml. ---
--- Finished configuring wc-search.xml. ---


**************************************************************
Finished configuring WebSphere Commerce for Solr cores
**************************************************************



**************************************************************
Started setup for Solr cores
**************************************************************
Master Catalog Id: 10051
Index Type: CatalogEntry
Languages: [en_US, fr_FR, de_DE, it_IT, es_ES, pt_BR, zh_CN, zh_TW, ru_RU, ko_
, ja_JP, ro_RO, pl_PL]
**************************************************************

--- Started checking directories for setup Solr cores. ---
--- Finished checking directories for setup Solr cores. ---

**************************************************************
The following languages passed directory validation:
- en_US
- fr_FR
- de_DE
- it_IT
- es_ES
- pt_BR
- zh_CN
- zh_TW
- ru_RU
- ko_KR
- ja_JP
- ro_RO
- pl_PL

The following Solr cores will setup:
- MC_10051_CatalogEntry_en_US
- MC_10051_CatalogEntry_Unstructured_en_US
- MC_10051_CatalogEntry_fr_FR
- MC_10051_CatalogEntry_Unstructured_fr_FR
- MC_10051_CatalogEntry_de_DE
- MC_10051_CatalogEntry_Unstructured_de_DE
- MC_10051_CatalogEntry_it_IT
- MC_10051_CatalogEntry_Unstructured_it_IT
- MC_10051_CatalogEntry_es_ES
- MC_10051_CatalogEntry_Unstructured_es_ES
- MC_10051_CatalogEntry_pt_BR
- MC_10051_CatalogEntry_Unstructured_pt_BR
- MC_10051_CatalogEntry_zh_CN
- MC_10051_CatalogEntry_Unstructured_zh_CN
- MC_10051_CatalogEntry_zh_TW
- MC_10051_CatalogEntry_Unstructured_zh_TW
- MC_10051_CatalogEntry_ru_RU
- MC_10051_CatalogEntry_Unstructured_ru_RU
- MC_10051_CatalogEntry_ko_KR
- MC_10051_CatalogEntry_Unstructured_ko_KR
- MC_10051_CatalogEntry_ja_JP
- MC_10051_CatalogEntry_Unstructured_ja_JP
- MC_10051_CatalogEntry_ro_RO
- MC_10051_CatalogEntry_Unstructured_ro_RO
- MC_10051_CatalogEntry_pl_PL
- MC_10051_CatalogEntry_Unstructured_pl_PL

**************************************************************

--- Started copying Solr core files. ---
--- Finished copying Solr core files. ---

--- Started configuring DIH (wc-data-config.xml). ---
--- Finished configuring DIH (wc-data-config.xml). ---

--- Started registering Solr core in solr.xml. ---
--- Finished registering Solr core in solr.xml. ---


**************************************************************
Started setup for Solr cores
**************************************************************
Master Catalog Id: 10051
Index Type: CatalogGroup
Languages: [en_US, fr_FR, de_DE, it_IT, es_ES, pt_BR, zh_CN, zh_TW, ru_RU, ko_
, ja_JP, ro_RO, pl_PL]
**************************************************************

--- Started checking directories for setup Solr cores. ---
--- Finished checking directories for setup Solr cores. ---

**************************************************************
The following languages passed directory validation:
- en_US
- fr_FR
- de_DE
- it_IT
- es_ES
- pt_BR
- zh_CN
- zh_TW
- ru_RU
- ko_KR
- ja_JP
- ro_RO
- pl_PL

The following Solr cores will setup:
- MC_10051_CatalogGroup_en_US
- MC_10051_CatalogGroup_fr_FR
- MC_10051_CatalogGroup_de_DE
- MC_10051_CatalogGroup_it_IT
- MC_10051_CatalogGroup_es_ES
- MC_10051_CatalogGroup_pt_BR
- MC_10051_CatalogGroup_zh_CN
- MC_10051_CatalogGroup_zh_TW
- MC_10051_CatalogGroup_ru_RU
- MC_10051_CatalogGroup_ko_KR
- MC_10051_CatalogGroup_ja_JP
- MC_10051_CatalogGroup_ro_RO
- MC_10051_CatalogGroup_pl_PL

**************************************************************

--- Started copying Solr core files. ---
--- Finished copying Solr core files. ---

--- Started configuring DIH (wc-data-config.xml). ---
--- Finished configuring DIH (wc-data-config.xml). ---

--- Started registering Solr core in solr.xml. ---
--- Finished registering Solr core in solr.xml. ---

Build and execute process job finished at 2013-09-20 12:30:46

Program exiting with exit code: 0.
Search index setup successfully completed without errors.

Utility stopped at 2013-09-20 12:30:46
Total running time is 13.37 seconds.



After you set up the search index structure for a specific master catalog, you must preprocess the search index data.

2. di-preprocess.bat full-path [-fullbuild true | false] [-localename localename] [-onelevel true | false] [-multithread true | false]

eg :

 di-preprocess.bat  C:\WCDE_ENT70\search\pre-processConfig\MC_10051\Cloudscape

The Directories would have formed if the Search index setup had run successfully with exit code 0.


Sample Logs

INFO: F:\WCDE_ENT70\search\pre-processConfig\MC_10051\Cloudscape\CatalogGroup
-dataimport-preprocess-common.xml
Sep 20, 2013 12:40:17 AM com.ibm.commerce.foundation.dataimport.preprocess.Da
mportPreProcessorMain processDataConfig(DataProcessingConfig, String)
INFO: table:
Sep 20, 2013 12:40:17 AM com.ibm.commerce.foundation.dataimport.preprocess.Ab
actDataPreProcessor populateTable(PreparedStatement, Long, Connection)
INFO: The batch is being executed...
Sep 20, 2013 12:40:17 AM com.ibm.commerce.foundation.dataimport.preprocess.Ab
actDataPreProcessor populateTable(PreparedStatement, Long, Connection)
INFO: Batch execution completed.
Sep 20, 2013 12:40:17 AM com.ibm.commerce.foundation.dataimport.preprocess.Da
mportPreProcessorMain processDataConfig
INFO: Data import pre-processing completed in 0.152 seconds for table TI_CATG
EL_3.
Sep 20, 2013 12:40:17 AM com.ibm.commerce.foundation.dataimport.preprocess.Da
mportPreProcessorMain processDataConfig(DataProcessingConfig, String)
INFO: F:\WCDE_ENT70\search\pre-processConfig\MC_10051\Cloudscape\CatalogGroup
-dataimport-preprocess-common.xml
Sep 20, 2013 12:40:17 AM com.ibm.commerce.foundation.dataimport.preprocess.Da
mportPreProcessorMain processDataConfig(DataProcessingConfig, String)
INFO: table:
Sep 20, 2013 12:40:17 AM com.ibm.commerce.foundation.dataimport.preprocess.Ab
actDataPreProcessor populateTable(PreparedStatement, Long, Connection)
INFO: The batch is being executed...
Sep 20, 2013 12:40:17 AM com.ibm.commerce.foundation.dataimport.preprocess.Ab
actDataPreProcessor populateTable(PreparedStatement, Long, Connection)
INFO: Batch execution completed.
Sep 20, 2013 12:40:17 AM com.ibm.commerce.foundation.dataimport.preprocess.Da
mportPreProcessorMain processDataConfig
INFO: Data import pre-processing completed in 0.171 seconds for table TI_DPGR
_3.
Sep 20, 2013 12:40:17 AM com.ibm.commerce.foundation.dataimport.preprocess.Da
mportPreProcessorMain processDataConfig(DataProcessingConfig, String)
INFO: F:\WCDE_ENT70\search\pre-processConfig\MC_10051\Cloudscape\CatalogGroup
-dataimport-preprocess-common.xml
Sep 20, 2013 12:40:17 AM com.ibm.commerce.foundation.dataimport.preprocess.Da
mportPreProcessorMain processDataConfig(DataProcessingConfig, String)
INFO: table:
Sep 20, 2013 12:40:20 AM com.ibm.commerce.foundation.dataimport.preprocess.Da
mportPreProcessorMain processDataConfig
INFO: Data import pre-processing completed in 2.89 seconds for table TI_CGSEO
_3_#lang_tag#.
Sep 20, 2013 12:40:20 AM com.ibm.commerce.foundation.dataimport.preprocess.Da
mportPreProcessorMain logExitCode
INFO:
The program exiting with exit code: 0.
Data import pre-processing completed successfully with no errors.

Sep 20, 2013 12:40:20 AM com.ibm.commerce.foundation.dataimport.preprocess.Da
mportPreProcessorMain logEndDateAndTime
INFO: Data import pre-processing ended:Fri Sep 20 00:40:20 IST 2013
Sep 20, 2013 12:40:20 AM com.ibm.commerce.foundation.dataimport.preprocess.Da
mportPreProcessorMain logEndDateAndTime
INFO: Data import pre-processing completed in 56.491 seconds.


Verify that the Program executed successfully.

Also, inspect the following file for errors:
To get more logging information, update the logging level from INFO to FINEST in the following file:
# Default global logging level, INFO
.level=FINEST
You can also increase the log file size and the number of log files. For example:
# Limiting size of output file in bytes:
java.util.logging.FileHandler.limit=50000000

# Number of output files to cycle through
java.util.logging.FileHandler.count=2 

Well now for the last step .

After preprocessing the search index data, you must build the search index.

Start the server.

navigate to bin folder.
run the following.

di-buildindex.bat -instance instance_name -masterCatalogId masterCatalogId [-indextype indextype] -dbuser dbuser -dbuserpwd dbuserpwd [-fullbuild true | false] [-statusInterval statusInterval] [-localename localename] [-indexSubType indexSubType] [-basePath basePath] [-storeId storeId] [-webcontentDelete true | false] [-solrConnTimeout solrConnTimeout] [-soTimeout soTimeout] [-workspace workspaceId] [-force true | false


eg:  di-buildindex.bat -masterCatalogId 10051 -basePath C:\WCDE_ENT70\workspace\StaticContent\WebContent\Madisons\StaticContent\en_US

In this case i have a seperate project StaticContent.

Monday, 25 November 2013

Websphere Commerce Migration Is it Worth ..

In a normal lifecycle of any Enterprise Application Product Offering, there will always be a time when the existing application might be outdated compared to the latest offering of the Product or platform .There also comes a time when the existing Application might run out of service warranty from the Product Vendors.
These are the times when migration comes in. 
Most of the time the existing implementation might still be meeting the immediate needs for which the initial implementation had been made  and hence it would not make sense to upgrade just because the product vendor decided to launch a new upgrade.

The new Upgrade will definitely be a technological upgrade , but justifying the business need for the upgrade requires outlining  the business benefits ,strategy and migration plans.

But below are questions that have to asked to justify upgrades /Migration.

Will the upgrade offer sizeable savings compared to the current running costs  or
Will it enable the business to target its customers/ end users differently which would indirectly result in increased revenue.
Would the upgrade enable the business to target a hitherto untapped customer base.

Any of the above if true can be used to justify a need for Migration of the Existing Platform.

The benefits of  the above should justify for  the costs below.
The effort required to proceed with the migration can be gauged from the below points.
However, there are a number of best practices which can guide you through these migrations. The following items can impact your migration:

  • The level of customization of the site.
  • The size/complexity of the WebSphere Commerce site.
  • The level of integration of WebSphere Commerce with third-party systems.                                

However no piece of software can be run indefinitely and hence there will always be a certain point where it will no longer be up to the mark and then it has be called out and upgraded or replaced.

Tuesday, 1 October 2013

IBM WCS Dynacache and getting the Extended Cache Monitor installed



As a top tier Enterprise Application catering to the eCommerce Market , One of the Addon Features that Websphere Commerce provides the DynaCache. Although IBM has other products aimed is specifically addressing Caching, since the DynaCache is integrated with WAS server it is a cost effective limited solution.
IBM Websphere eXtreme Scale is a powerful elastic cache solution for advanced cache solutions.

Caching is generally asscociated with static content such as graphics, images , files that rarely change. However, in this age of personalized experiences , websites serve personalized information or data depending on the end user and this changes frequently.

WAS  provides a built in service for caching , using which WCS provides caching of dynamic content using defined caching techniques.
Cachespec.xml is provided for the user to specify and control Caching and invalidation of Views ( Commands or JSP views ).
DynaCache as the name suggests is provided for caching Dynamic Content.


The Dynamic caching service includes :

- Servlet and JSP result cache
     Whole Pages or fragments of a page are cached.
- Command cache
      Commands that implement the CacheableCommand ( cache command objects )
- Edge Side Include (ESI) caching
     To assemble fragments and deliver complete dynamic web pages.
- Cache Invalidation
     Invalidation rules to flush out a cached resource when it may no longer be required based on
1. rule based
2 . time based
3. group based
4. programmatic.


 - Cache Replication  
    To enable cache sharing and replication across multiple servers.

- Disk offload capability
    The cache eats up a lot of valuable runtime memory space. Also the cache slots available is limited and Cached requests are flushed out to make space for new ones once the cache gets filled.
Also since the Cache is maintained in the runtime memory of the server on server restarts this gets lost. This might manifest as an issue on a live production server. 

Now If the Disk Offload is enabled ,
     Once the space allocated for the cache gets filled, The entries that are flushed/invalidated are moved to the Hard disk. The server would maintain an index of the Cache IDs in the disk cache. Thus a much higher number of cache entries can be maintained in the Application server .
Also , on server restarts since the offloaded cache is still available , the cache content is preserved.

    To enable caching large amounts of data, and to preserve cache content while the application server is stopped and restarted. 

Note: After the application server is restarted and the database is restored, it is recommended that you clear the disk cache using the cache monitor. Clear the disk cache to ensure that information that is invalid for the new database is removed. Use the cache monitor  http://host_name:Port/cachemonitor to clear the cache or, alternatively, use the following URL: http://host_name/path/DynaCacheInvalidation?clear=true.


Limitations of dynamic caching

If you use the cachespec.xml file to enable invalidation you might encounter the following behavior:
  • When you create a catalog entry or move a catalog entry from one category to another in the Management Center, the catalog entry would not show up on the storefront.
  • When you create a category in the Management Center, the category would not show up on the storefront.
  • When you update a child object in the Management Center, the parent object cache entry is not automatically invalidated. For example, when you update a catalog entry in the Management Center, the category display page does not reflect the updates in the storefront.
  • Similar anomalies might be encountered while using bod service commands to update changes in a different Backend Application , while the caching is done based on Commands and Views and there is no relevant invalidation configured based on bod service commands invoked. 

 Enabling Sevlet caching

 In order to enable servlet caching do the following. 
 Navigate to http://localhost:9060/admin  ( WAS admin console ) and to the Application server

Click on the Web container
 Select the check box. and click ok. Ensure to save changes to the Master Configuration.

 Installing the Cache Monitor 

The cache Monitor will enable you to view the Cache Content , cache ID , Dependency ID and cache statistics ( Cache Hit / Cache Misses ) etc. It can also be used to clean the cache or selectively invalidate a specific cache entry ( never advised ) .
The Cache Monitor can be installed as a new application on the WAS server. The CacheMonitor.ear can be found on a developer machine 
@ Location  ..\..\IBM\SDP\runtimes\base_v7\installableApps\

Navigate to http://localhost:9060/admin  ( WAS admin console )
Click on Install . 

Browse to the above mentioned file CacheMonitor.ear in the local file system. 

Click Next at the next three screens .
 Step1 , Step 2 Step 3 
Make sure to select CacheMonitor.ear  @ Step 2. 


The IBM Extended Cache Monitor for IBM WebSphere Application Server provides you with two functions that are not available with the cache monitor that is supplied with WebSphere Application Server. These two functions enable you to:
  • display the contents of object cache instances
  • display the Dynamic Cache mbean statistics for cache instances
 
 
The Extended cache Monitor can be installed as mentioned @
http://www.ibm.com/developerworks/websphere/downloads/cache_monitor.html

Incase you run into errors make sure of the following.
Note: The CacheMonitor.ear should be directly under the cachemonitor7_update.zip