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

My Writings........

HCL Commerce v9.1 | Local Store Vs Remote Store

  Local Store Remote Store Project Type Migrated (Lift & Shift) - Newly Imp...