Null pointer exception with EAR deployment using IBM Gift Center
 Flash (Alert)
Abstract
This technote applies to all environments running WebSphere Commerce version 6.0 with IBM Gift Center enabled. In that environment, you will get a null pointer exception after EAR re-deployment.

EAR re-deployment includes activities such as these:
-- Installing a WebSphere Commerce fix pack
-- Installing a WebSphere Commerce APAR
-- Re-deploying customized code
-- Synchronizing the EAR file in a cluster
Content
You will get the following message in your store pages after EAR re-deployment:

java.lang.NullPointerException
at com.ibm.commerce.giftregistry.beans.GiftRegistryContextDataBean.getNumberOfExternalIdsByRegistrantRelationship(GiftRegistryContextDataBean.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
...
The IBM Gift Center enablement script performs updates to the expanded Commerce EAR file. However, it does not make the same update to the collapsed EAR file. Since WAS uses the collapsed EAR file for deployment, the IBM Gift Center updates will be overwritten and lost, causing the error message above.

The following temporary workaround is available:

  1. Make a backup copy of the following file:
    <WAS_HOME>\profiles\<profile>\installedApps\WC_<cell>\WC_<instance>.ear\xml\config\wc-server.xml

    This backup should be performed after enabling IBM Gift Center and before attempting any deployment activity.

  2. Perform the EAR re-deployment.

  3. Replace the current wc-server.xml file with the backed up version.

Cross Reference information
Segment Product Component Platform Version Edition
Commerce WebSphere Commerce Professional Edition Gift Center AIX, i5/OS, Linux, Linux iSeries, Linux pSeries, Linux xSeries, Linux zSeries, OS/390, Solaris, Windows 6.0, 6.0.0.1 Professional Edition
Commerce IBM Gift Center for WebSphere Commerce Not Applicable AIX, Linux, Solaris, Windows 6.0 All Editions
   

Document Information

Current web document: http://www.ibm.com/support/docview.wss?uid=swg21250002