WebSphere Commerce 7 | Payment Instructions are Failing | NullPointerException on "createPaymentInstruction"

In my toolkit, few of the data got corrupted and when I try to test the payment pages, it is throwing the following exception,

[4/18/16 9:53:41:332 GMT] 0000006b RemoteExcepti E   CNTR0020E: EJB threw an unexpected (non-declared) exception during invocation of method "createPaymentInstruction" on bean "BeanId(WC_live#Payments-Plugin-Controller.jar#PluginController, null)". Exception data: java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:877)
        at com.ibm.commerce.payments.plugincontroller.PluginController.getPlugin(PluginController.java:2908)
        at com.ibm.commerce.payments.plugincontroller.PluginController.createPaymentInstruction(PluginController.java:986)
        at com.ibm.commerce.payments.plugincontroller.beans.EJSRemoteStatelessPluginController_c947b422.createPaymentInstruction(EJSRemoteStatelessPluginController_c947b422.java:399)
        at com.ibm.commerce.payments.plugincontroller.beans._PluginController_Stub.createPaymentInstruction(_PluginController_Stub.java:2511)
        at com.ibm.commerce.payment.actions.commands.EditPaymentInstructionPolicyCmdImpl.createPaymentInstruction(EditPaymentInstructionPolicyCmdImpl.java:633)
        at com.ibm.commerce.payment.actions.commands.EditPaymentInstructionPolicyCmdImpl.performExecute(EditPaymentInstructionPolicyCmdImpl.java:244)
        at com.ibm.commerce.command.ECCommandTarget.executeCommand(ECCommandTarget.java:157)
        at com.ibm.ws.cache.command.CommandCache.executeCommand(CommandCache.java:332)
        at com.ibm.websphere.command.CacheableCommandImpl.execute(CacheableCommandImpl.java:166)
        at com.ibm.commerce.command.MeasuredCacheableCommandImpl.execute(MeasuredCacheableCommandImpl.java:63)
        at com.ibm.commerce.command.AbstractECTargetableCommand.execute(AbstractECTargetableCommand.java:199)
        at com.ibm.commerce.edp.commands.EditCmdImpl.setupAndCreatePaymentInstruction(EditCmdImpl.java:2516)
        at com.ibm.commerce.edp.commands.EditCmdImpl.addPaymentInstruction(EditCmdImpl.java:1039)
        at com.ibm.commerce.edp.commands.EditCmdImpl.processNewPIOperation(EditCmdImpl.java:1726)
        at com.ibm.commerce.edp.commands.EditCmdImpl.processIndividualPIEditOperation(EditCmdImpl.java:1706)
        at com.ibm.commerce.edp.commands.EditCmdImpl.processFG(EditCmdImpl.java:783)
        at com.ibm.commerce.edp.commands.EditCmdImpl.performExecute(EditCmdImpl.java:438)
        at com.ibm.commerce.command.ECCommandTarget.executeCommand(ECCommandTarget.java:157)
        at com.ibm.ws.cache.command.CommandCache.executeCommand(CommandCache.java:332)
...............
...............
Caused by: com.ibm.commerce.exception.ECApplicationException: The payment system encounters an error when updating the payment instructions of order 131,006. GenericSystemError
        at com.ibm.commerce.edp.commands.PIAddCmdImpl.addPI(PIAddCmdImpl.java:502)
        at com.ibm.commerce.edp.commands.PIAddCmdImpl.performExecute(PIAddCmdImpl.java:360)
        at com.ibm.commerce.command.ECCommandTarget.executeCommand(ECCommandTarget.java:157)
        at com.ibm.ws.cache.command.CommandCache.executeCommand(CommandCache.java:332)
        at com.ibm.websphere.command.CacheableCommandImpl.execute(CacheableCommandImpl.java:166)
        at com.ibm.commerce.command.MeasuredCacheableCommandImpl.execute(MeasuredCacheableCommandImpl.java:63)
        at com.ibm.commerce.command.AbstractECTargetableCommand.execute(AbstractECTargetableCommand.java:199)
        at com.ibm.commerce.foundation.server.command.soi.MessageMappingCmdImpl.invokeCommand(MessageMappingCmdImpl.java:229)



Issue might have happened because your MERCHCONFINFO Tables doesn't have proper entries. Try to correct entries between MERCHCONF and MERCHCONFINFO Tables and it should work fine   

WebSphere Commerce 7 | Upgraded WCS 7.0.0.6 to WCS 7.0.0.7 | Fix Pack 7 | Payment Pages are Failing | CWXFR0020E, CWXFD3134E

I have upgraded my toolkit from WCS 7.0.0.6 to WCS 7.0.0.7 (Applied Fix Pack 7 - Database is DB2) and after that, payment pages are failing with the following exception,

[5/9/16 23:32:42:137 CLT] 00000024 bod   E   CWXFD3134E: Execution of get request failed. CWXFR0020E: Could not get a database connection for component com.ibm.commerce.wallet
com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException: CWXFD3134E: Execution of get request failed. CWXFR0020E: Could not get a database connection for component com.ibm.commerce.wallet
at com.ibm.commerce.foundation.server.command.bod.bom.AbstractFetchNounUsingBusinessObjectMediatorCmdImpl.performExecute(AbstractFetchNounUsingBusinessObjectMediatorCmdImpl.java:255)
at com.ibm.commerce.foundation.internal.server.command.impl.CommandTarget.executeCommand(CommandTarget.java:66)
at com.ibm.websphere.command.TargetableCommandImpl.execute(TargetableCommandImpl.java:139)


While doing the debug of the issue, I have noticed it is not pointing to my actual DB2 Database. Instead, it is pointing to Cloudscape Database.

Here is the issue,
1. Features has been enabled with FEP5 with Cloudscape
2. On top of it, setdbtype command has been run with DB2
3. Because of this, DB2 related libraries are not available in WC Project and instead, it has Cloudscape related libraries.

Resolution:
Copy all the JAR files from (DB2),
WCDE_installdir\components\foundation\wc.ear.ext\db2 to WCDE_installdir\workspace\WC

WebSphere Commerce 7 | IBM HTTP Server | Steps for setting up IBM HTTP Server

Here are the steps for installing IBM HTTP Server and configuring with WebSphere Commerce,
 
  • Move all your static content (Like Images/CSS/JS etc) from Stores project and move it to a StaticWeb Project so that, it will easy to maintain the static assets separately rather than in Stores Project. Later, you can easily move these static contents from this project to your Web Server.
  • Install IBM HTTP Server with the steps mentioned in following document,
  • Update the following tags in C:\WebSphere\IHS\conf\httpd.conf to point out to StaticWeb Project, 
       <VirtualHost *:80>
       <VirtualHost *:443>
       <VirtualHost *:8006>


       Here is the snippet,
       <VirtualHost *:80>
        ServerName *
        Alias  /wcsstore  "W:\IBM\WCDE_ENT70\workspace\StaticWeb\WebContent"
        Alias  /wcs  "W:\IBM\WCDE_ENT70\workspace\CommerceAccelarator\WebContent"

        Alias  /css  "W:\IBM\WCDE_ENT70\workspace\StaticWeb\WebContent\css"
        Alias  /js  "W:\IBM\WCDE_ENT70\workspace\StaticWeb\WebContent\js"
        Alias  /icons  "W:\IBM\WCDE_ENT70\workspace\StaticWeb\WebContent\icons"
        Alias  /images  "W:\IBM\WCDE_ENT70\workspace\StaticWeb\WebContent\images"
        Alias  /contentspots  "W:\IBM\WCDE_ENT70\workspace\StaticWeb\WebContent\contentspots"

        # Example:  Turn on the rewrite engine.
        RewriteEngine On
    </VirtualHost>

    <VirtualHost *:443>
        SSLEnable
        SSLClientAuth 0
        ServerName *
        Alias  /wcsstore  "W:\IBM\WCDE_ENT70\workspace\StaticWeb\WebContent"
        Alias  /wcs  "W:\IBM\WCDE_ENT70\workspace\CommerceAccelarator\WebContent"

        Alias  /css  "W:\IBM\WCDE_ENT70\workspace\StaticWeb\WebContent\css"
        Alias  /js  "W:\IBM\WCDE_ENT70\workspace\StaticWeb\WebContent\js"
        Alias  /icons  "W:\IBM\WCDE_ENT70\workspace\StaticWeb\WebContent\icons"
        Alias  /images  "W:\IBM\WCDE_ENT70\workspace\StaticWeb\WebContent\images"
        Alias  /contentspots  "W:\IBM\WCDE_ENT70\workspace\StaticWeb\WebContent\contentspots"
    </VirtualHost>

    <VirtualHost *:8006>
        SSLEnable
        SSLClientAuth 0
        ServerName *
        Alias /wcsstore "W:\IBM\WCDE_ENT70\workspace\Stores\WebContent"
        Alias /wcs "W:\IBM\WCDE_ENT70\workspace\Stores\WebContent"
    </VirtualHost>

  • Make sure that no other application is using Port 80. You might face the following issue and here is the resolution for the same,
        http://yashodtechtalk.blogspot.in/2016/05/wcs-ibm-http-server-failed-to-start.html
  • Restart the HTTP Server
  • After doing these changes, the static content will be served from HTTP Server rather than WebSphere Application Server

WebSphere Commerce 7 | IBM HTTP Server | Failed to Start | make_sock: could not bind to address 0.0.0.0:80

I tried to setup IBM HTTP Server V7.0 by following the document,
http://www.ibm.com/developerworks/library/co-config-httpserver-was/

After the setup, when I tried to start the server, here is the error message
(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted.  : make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Note the errors or messages above, and press the <ESC> key to exit.  16...

Tried multiple things to check whether any other application is running on Port 80. But I didn't noticed any application is running on Port 80.

Later noticed the issue and here it is,
In C:\WebSphere\IHS\conf\httpd.conf file, the following line got duplicated
Listen 0.0.0.0:80

After commented the duplicate line, It is working fine as expected

WebSphere Commerce 7 | User Management | Reset Password

In Development Environment, if you wanted to reset the user credentials, you can follow these steps,

Scenario - 1 (If you don't know the Merchant Key):
In local environment, if you know any user credentials (Eg: MyUser1) and need to update another user credentials (Eg: MyUser2) with the same, here is the setup of queries, you need to execute,

    update userreg set SALT = (select SALT from userreg where LOGONID = 'MyUser1') where LOGONID = 'MyUser2'
    update userreg set LOGONPASSWORD = (select LOGONPASSWORD from userreg where LOGONID = 'MyUser1') where LOGONID = 'MyUser2';
    update userreg set status = 1 where logonid = 'MyUser2';
    update userreg set passwordexpired = 0 where logonid='MyUser2'; 


Scenario - 2 (If you know the Merchant Key):

If you know merchant key and here is the procedure,

1. Run the command
    wcs_password.bat <Your required password> <Your required Salt> <Merchant Key>
   
    Eg: wcs_password.bat myPassw0rd mySalt 0123456789abcdef
   
   It will generate encrypted password,
  
    Eg: 34jmgfjspuw93rsjdfi-qua4wd
  
2. Run the following queries,
    update userreg set SALT = 'mySalt' where LOGONID = 'wcsadmin'
    update userreg set LOGONPASSWORD = '34jmgfjspuw93rsjdfi-qua4wd' where LOGONID = 'wcsadmin';
    update userreg set status = 1 where logonid = 'wcsadmin';
    update userreg set passwordexpired = 0 where logonid='wcsadmin';

WebSphere Commerce 7 | Access Control Policies | Inserting Access Control Policies through SQL

Here are the queries, you need to execute to insert Access Control Policies for Views and Controller Commands,

--Query for ACL to insert a View
INSERT INTO ACACTION (ACACTION_ID, ACTION) VALUES ((SELECT COUNTER FROM KEYS WHERE TABLENAME='acaction'), 'MyNewView');

INSERT INTO ACACTACTGP (ACACTGRP_ID,ACACTION_ID) VALUES
((SELECT ACACTGRP_ID FROM ACACTGRP WHERE GROUPNAME = 'AllSiteUsersViews'
AND MEMBER_ID IN (SELECT ORGENTITY_ID FROM ORGENTITY WHERE ORGENTITYNAME='Root Organization')
),(SELECT ACACTION_ID FROM ACACTION WHERE ACTION='MyNewView'));

UPDATE KEYS SET COUNTER = COUNTER+1 WHERE TABLENAME = 'acaction';

--Query for ACL to insert a Command
INSERT INTO ACRESCGRY
(ACRESCGRY_ID,RESCLASSNAME)
VALUES
((SELECT COUNTER FROM KEYS WHERE TABLENAME='acrescgry'),'com.ibm.commerce.sample.commands.MyNewControllerCmd');

INSERT INTO ACRESACT
(ACRESCGRY_ID, ACACTION_ID)
VALUES
((SELECT COUNTER FROM KEYS WHERE TABLENAME='acrescgry'),(SELECT ACACTION_ID FROM ACACTION WHERE ACTION='Execute'));

INSERT INTO ACRESGPRES
(ACRESGRP_ID, ACRESCGRY_ID)
VALUES
((SELECT ACRESGRP_ID FROM ACRESGRP WHERE MEMBER_ID IN
(SELECT ORGENTITY_ID FROM ORGENTITY WHERE ORGENTITYNAME='Root Organization') and GRPNAME='AllSiteUserCmdResourceGroup'),
(SELECT COUNTER FROM KEYS WHERE TABLENAME='acrescgry'));

UPDATE KEYS SET COUNTER = COUNTER+1 WHERE TABLENAME = 'acrescgry';

WebSphere Commerce 7 | Search | Click on Category Pages Failing | CWXFS0010E

After FEP8 migration and when category pages are clicked, it is throwing the following exception,

CWXFS0010E: Failed to execute search request because the current store does not have a valid search configuration.
        at com.ibm.commerce.catalog.facade.client.AbstractCatalogFacadeClient.checkShowCatalogNavigationView(AbstractCatalogFacadeClient.java:1796)
        at com.ibm.commerce.catalog.facade.client.AbstractCatalogFacadeClient.getCatalogNavigationView(AbstractCatalogFacadeClient.java:1827)


And later, I have noticed WC/xml/config/com.ibm.commerce.catalog-ext/wc-search.xml was empty with the following content,



Content of the file:
<_config:cores>
</_config:cores>

I have updated the file with the search-configuration and core information and it started working fine,


WebSphere Commerce 7 | User Login Failing | After Logout, it doesn't work

I have noticed in my local toolkit, User Registration was working fine. But, if you logout from the store, I am not able to login again with the same user. And in the logs also, I didn't notice any exception

Issue:
WC\xml\member\MemberRegistrationAttributes.xml was some how corrupted and it was empty

Fix:
After replaced WC\xml\member\MemberRegistrationAttributes.xml with the original file and after build and deploy, it started working fine


Thanks Vivek Kumar for quickly noticed the issue.



WebSphere Commerce 7 | Local Toolkit | "Loose Archive Resources path" Error

When ever you notice the following exception when you start the server in local environment,



Check whether all the paths and configurations are proper in the following files,
1. workspace\WC\xml\config\ToolkitModuleConfig.xml
2. workspace\.metadata\.plugins\com.ibm.etools.wrd.websphere.v7\looseconfigurations\WebSphereCommerceTestServer\WC\looseconfig.xmi

WebSphere Commerce 7 | Storefront | Enable "SearchBasedNavigation" through Queries

If you have problem logging in Management Center and  still wanted to enable Search Based Navigation through the Queries then here is the approach,

Queries to check whether Search Based Navigation is enabled,
select * from emspot where name = 'SearchBasedNavigation';
select * from DMEMSPOTDEF where emspot_id in (select emspot_id from emspot where name = 'SearchBasedNavigation'); 


Queries to enable Search Based Navigation for the store,
insert into emspot(emspot_id, storeent_id, name, usagetype, up_name) values ((select max(emspot_id)+1 from emspot), 10101, 'SearchBasedNavigation', 'STOREFEATURE', 'SEARCHBASEDNAVIGATION');
insert into DMEMSPOTDEF(dmemspotdef_id, emspot_id, storeent_id, contenttype, content, optcounter, sequence)
    values (
        (select max(DMEMSPOTDEF_ID) + 1 from DMEMSPOTDEF),
        (select emspot_id from emspot where name = 'SearchBasedNavigation' and storeent_id = 10101),
        10101,
        'FeatureEnabled',
        'true',
        0,
        0
    );

My Writings........

Salesforce | Administration | Email-to-Case | Create Cases using Email-to-Case

Email to Case Setup ·        Click on Email-to-Case ·         Enable the following flags, ·        Provide the Routing Addres...