Monday, April 27, 2015

SSL HANDSHAKE FAILURE | Signer Certificate retrieve from port


CWPKI0022E: SSL HANDSHAKE FAILURE:  A signer with SubjectDN "CN=localhost, O=IBM, C=US" was sent from target host:port "localhost:443".  The signer may need to be added to local trust store "C:/IBM/WCD70_2/wasprofile/config/cells/localhost/nodes/localhost/trust.p12" located in SSL configuration alias "NodeDefaultSSLSettings" loaded from SSL configuration file "security.xml".  The extended error message from the SSL handshake exception is: "PKIX path building failed: java.security.cert.CertPathBuilderException: unable to find valid certification path to requested target".
00000053 SystemOut     O
00000053 SystemOut     O CWPKI0022E: SSL HANDSHAKE FAILURE:  A signer with SubjectDN "CN=localhost, O=IBM, C=US" was sent from target host:port "localhost:443".  The signer may need to be added to local trust store "C:/IBM/WCD70_2/wasprofile/config/cells/localhost/nodes/localhost/trust.p12" located in SSL configuration alias "NodeDefaultSSLSettings" loaded from SSL configuration file "security.xml".  The extended error message from the SSL handshake exception is: "PKIX path building failed: java.security.cert.CertPathBuilderException: unable to find valid certification path to requested target".
00000053 SystemOut     O
00000053 SystemOut     O
00000053 SystemOut     O CWPKI0428I: The signer might need to be added to the local trust store. You can use the Retrieve from port option in the administrative console to retrieve the certificate and resolve the problem. If you determine that the request is trusted, complete the following steps: 1. Log into the administrative console.  2. Expand Security and click SSL certificate and key management. Under Configuration settings, click Manage endpoint security configurations. 3. Select the appropriate outbound configuration to get to the (cell):localhost:(node):localhost management scope. 4. Under Related Items, click Key stores and certificates and click the NodeDefaultTrustStore key store. 5. Under Additional Properties, click Signer certificates and  Retrieve From Port.  6. In the Host field, enter localhost in the host name field, enter 443 in the Port field, and localhost_cert in the Alias field. 7. Click Retrieve Signer Information.  8. Verify that the certificate information is for a certificate that you can trust. 9. Click Apply and Save.
00000053 SystemOut     O
00000053 ExtendedInfo  I   CWXFR9010I: Extended information : [URL=https://localhost:8006/webapp/wcs/preview/servlet/static/helloworld/dewalt] [parameters=deleteCartCookie=true  ] [userId=-1002]
00000053 LoggingHelper E /GenericJSPPageError.jsp - java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.j: PKIX path building failed: java.security.cert.CertPathBuilderException: unable to find valid certification path to requested target
                                 javax.servlet.jsp.JspException: java.lang.RuntimeException: javax.net.ssl.SSLHandshakeException: com.ibm.jsse2.util.j: PKIX path building failed: java.security.cert.CertPathBuilderException: unable to find valid certification path to requested target
    at com.ibm.commerce.foundation.internal.client.taglib.RESTTag.myExecute(RESTTag.java:1238)
    at com.ibm.commerce.foundation.internal.client.taglib.RESTTag.execute(RESTTag.java:1067)
    at com.ibm.commerce.foundation.internal.client.taglib.RESTTag.doEndTag(RESTTag.java:537)

Goto Admin console -->Security section and
SSL certificate and key management > Key stores and certificates > NodeDefaultTrustStore > Signer certificates
Retrieve from port

Thursday, April 9, 2015

Catalog uploads(file upload) in Management Center | does not work in Firefox | CatalogEntrySEO

If you have done this in the past , you would know but there are no error messages in firefox and catalog uploads in management center (File upload) does not work. It works in IE but you need to every time click on settings and click Compatibility view settings and add localhost



E.g  If you want to upload for CatalogEntrySEO
File first 2 lines in the file to upload:
CatalogEntrySEO,,,,,,
PartNumber,LanguageId,URLKeyword,PageTitle,MetaDescription,ImageAltText,Delete

Settings for maxError and commit counts are defined at:
C:\IBM\WCDE_ENT70\workspace\WC\xml\config\com.ibm.commerce.catalog\dataload\wc-dataload.xml
You can also define them at individual load item level.



Tuesday, March 31, 2015

Solr PreProcessing Error | SYS_C00151674 | Debugging

com.ibm.commerce.foundation.dataimport.preprocess.CatalogHierarchyDataPreProcessor determineCatalogEntriesForCatalog(Connection connection, String catalogID)
INFO: The catalog with ID: 10051 contains 174468 catalog entries.
 com.ibm.commerce.foundation.dataimport.preprocess.DataImportPreProcessorMain processDataConfig(DataProcessingConfig, String)
INFO: ORA-00001: unique constraint (SYS_C00151674) violated


If any of these 2 queries finds rows, that would be a good pointer and backup deletes and run the delete's and try again.

Rule 1: In Master catalog, you should always have 1 catalog entry belong to 1 master catalog category and CMC and dataload enforces that but if the data is loaded through another channel, this could happen.

1) To identify if there is a catalog entry that has more than one parent category, run the following SQL query against the database:
select catentry_id, catgroup_id from catgpenrel where catentry_id in (select catentry_id from catgpenrel where catalog_id = group by catentry_id having count(catentry_id) > 1)
where is the catalog ID value for which di-preprocess is being run.

The above query will provide a list of catalog entry IDs and the categories that they are mapped to if they are mapped to more than one category in the master catalog ID.
 e.g.
select catentry_id, catgroup_id from catgpenrel
where catentry_id in (select catentry_id from catgpenrel where catalog_id = 10051 group by catentry_id having count(catentry_id) > 1);

Rule 2: You should have always 1 parent category for each master catalog category.
2) To identify if the issue is caused by a category having multiple parent categories in the master catalog, run the following SQL query against the database:
select catgroup_id_parent, catgroup_id_child from catgrprel where catalog_id = and catgroup_id_child in (select catgroup_id_child from catgrprel where catalog_id = group by catgroup_id_child having count(catgroup_id_child) > 1)
e.g.
select catgroup_id_parent, catgroup_id_child from catgrprel where catalog_id = 10051 and
catgroup_id_child in (select catgroup_id_child from catgrprel where catalog_id = 10051
group by catgroup_id_child having count(catgroup_id_child) > 1);

More Logging: Edit the logging.properties file:

    Runtime location: WC_installdir/instances/ instance_name/xml/config/dataimport/logging.properties
    Toolkit location: WCDE_INT70\workspace\WC\xml\config\dataimport\logging.properties
    Verify that .level=FINEST and java.util.logging.FileHandler.level=FINEST
    Verify that java.util.logging.FileHandler.limit=80000000
    Verify that java.util.logging.FileHandler.count=10 

Wednesday, March 4, 2015

Solr Build index fails | would not provide error information | run solr direct

Last I encountered an error where running build-index from toolkit would give the following 2 lines but it wouldn't rebuild index and do nothing.
The program exiting with exit code: 0.
Data import process completed successfully with no errors.


If you need to directly run index on SOLR server: This is the command
http://localhost/solr/MC_10051_CatalogEntry_en_US/dataimport?command=full-import

To Monitor:
http://localhost/solr/MC_10051_CatalogEntry_en_US/dataimport?command=status

Once I ran directly on SOLR, full-import, it gave the errors.
In this particular case, it gave heap error and had to increase 512 MB to 1024 MB in WAS admin console.

Sunday, March 1, 2015

IBM CMC | Approved Content error on read-only mode | Working on Approved content selection

When trying to edit content in CMC, the default mode is read-only and it requires clicking the gear icon on the menu to work on Approved content. Find below screenshots, below click




Thursday, January 8, 2015

Finally Enabling multiple logon for the same user | Available from Fix pack 9


This was something that was not available for a long time but with the new fix pack. This is available. I might have an old blog where i had mentioned, it was not available in the previous versions.

Many WebSphere Commerce websites are using REST services to serve both mobile and desktop pages then it's important to allow multiple logon for the same user from different channels in a simple way. To activate this feature a specific tag should be added to the wc-server.xml in the SessionManagement section

<allowmultiplelogonforsameuser display="false" enabled="true"></allowmultiplelogonforsameuser>

Tuesday, January 6, 2015

Performance Improvements StringBuilder and ArrayList and HashMap

Use StringBuilder if Synchronization is not required.

I have used StringBuffer when performing concatenations on string and is far better than using Immutable Strings in Java but if you don't need the synchronization, which most likely could be the case so use StringBuilder

Quote from StringBuilder API:
This class [StringBuilder] provides an API compatible with StringBuffer, but with no guarantee of synchronization. This class is designed for use as a drop-in replacement for StringBuffer in places where the string buffer was being used by a single thread (as is generally the case). Where possible, it is recommended that this class be used in preference to StringBuffer as it will be faster under most implementations.

Using ArrayList vs LinkedList

LinkedList is great when you don't know the size of the list as it helps.

The default initial capacity of an ArrayList is pretty small (10 from Java 1.4 - 1.7).
But since the underlying implementation is an array, the array must be re-sized if you add a lot of elements.
To avoid the high cost of resizing when you know you're going to add a lot of elements, construct the ArrayList with a higher initial capacity. What's important is to initialize the list when you know upfront the size of the ArrayList and if it is going to be more than 10

List catalogDataVOList = new ArrayList<CatalogDataVO>((int) resultCount);

Reference: http://stackoverflow.com/questions/322715/when-to-use-linkedlist-over-arraylist

Use HashMap vs Hashtable:
If Synchronization is not required use HashMap, Hashtable is a syncrhonized version and typically non synchronized objects perform better.