Sunday, February 23, 2014

Hybris HCM error

Experiencing below exception while playing with customized hMC.
Turned out I didn't update all the return value of my customized HMCExtension class correctly.



Most of methods, I should return "Collections.EMPTY_LIST;" rather "null" value.

sample of correct settings:

public List getToolbarActionChips(final DisplayState displayState, final Chip parent)
    {
        return Collections.EMPTY_LIST;
        return null;

    }






-------------------------------------
Exception log shows below:
-------------------------------------


ERROR [hybrisHTTP1] [ChipFactory] ============================================
ERROR [hybrisHTTP1] [ChipFactory] ChipFactory.getInstance(...) Exception (class java.lang.NullPointerException)
ERROR [hybrisHTTP1] [ChipFactory]       CoreClass:              class de.hybris.platform.hmc.ToolbarChip
ERROR [hybrisHTTP1] [ChipFactory]       CustomClass:            null
ERROR [hybrisHTTP1] [ChipFactory]       ParameterClasses                |               ParameterValues
ERROR [hybrisHTTP1] [ChipFactory]               0. Class: class de.hybris.platform.hmc.webchips.DisplayState
ERROR [hybrisHTTP1] [ChipFactory]               0. Value: de.hybris.platform.hmc.webchips.DisplayState@3732ed7c
ERROR [hybrisHTTP1] [ChipFactory]               1. Class: interface de.hybris.platform.hmc.webchips.Chip
ERROR [hybrisHTTP1] [ChipFactory]               1. Value: de.hybris.platform.hmc.ExplorerChip@70858433
ERROR [hybrisHTTP1] [ChipFactory] Stacktrace
java.lang.NullPointerException
        at de.hybris.platform.hmc.extension.SlotManager.getToolbarActionChips(SlotManager.java:331)
        at de.hybris.platform.hmc.AbstractToolbarChip.initialize(AbstractToolbarChip.java:298)
        at de.hybris.platform.hmc.ToolbarChip.(ToolbarChip.java:38)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at de.hybris.platform.hmc.ChipFactory.getInstance(ChipFactory.java:71)
        at de.hybris.platform.hmc.ChipFactory.getInstance(ChipFactory.java:135)
        at de.hybris.platform.hmc.ExplorerChip.(ExplorerChip.java:136)
        at de.hybris.platform.hmc.MainChip.openExplorer(MainChip.java:230)
        at de.hybris.platform.hmc.MainChip.processEvents(MainChip.java:149)
        at de.hybris.platform.hmc.webchips.DisplayState.dispatchEvents(DisplayState.java:638)
        at de.hybris.platform.hmc.webchips.DisplayState.extractEventsFromParameters(DisplayState.java:438)
        at de.hybris.platform.hmc.webchips.DisplayState.processEvents(DisplayState.java:354)
        at de.hybris.platform.hmc.webchips.MasterServlet.process(MasterServlet.java:193)
        at de.hybris.platform.hmc.webchips.MasterServlet.doPost(MasterServlet.java:83)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)