Skip to Content
author's profile photo Former Member
Former Member

N/A in Backoffice gives a NullPointerException

In B2BCommerce > B2BUnit under tab Administration, if there is a change done by n/a a NullPointerException is displayed (see screenshotalt text).

The error I see in the log is:

INFO | jvm 1 | srvmain | 2017/08/31 14:56:48.676 | java.lang.NullPointerException: null INFO | jvm 1 | srvmain | 2017/08/31 14:56:48.676 | at de.hybris.platform.platformbackoffice.labelproviders.SavedValuesLabelProvider.getLabel(SavedValuesLabelProvider.java:40) ~[?:?] INFO | jvm 1 | srvmain | 2017/08/31 14:56:48.676 | at de.hybris.platform.platformbackoffice.labelproviders.SavedValuesLabelProvider.getLabel(SavedValuesLabelProvider.java:1) ~[?:?] INFO | jvm 1 | srvmain | 2017/08/31 14:56:48.676 |

In HMC you see the changes are made by N/A alt text

Is there a way to remove this nullpointer and display N/A ? We are using hybris version 6.3

Thanks!

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Sep 01, 2017 at 09:26 AM

    Hi,

    it seems that there is a bug in the de.hybris.platform.platformbackoffice.labelproviders.SavedValuesLabelProvider#getLabel line 40:

     final String changedByValue = savedValues.getUser().getDisplayName();
    
    

    Apparently for some reason the user is null. We will fix the issue in 6.6. In your version the easiest fix is to override the configuration:

         <context type="SavedValues" component="base" merge-by="type" parent="GenericItem">
             <y:base>
                 <y:labels beanId="savedValuesLabelProvider"/>
             </y:base>
         </context>
    
    

    And point to another label provider (custom implementation). Unfortunately the savedValuesLabelProvider is a bean id, not an alias (will be also fixed in 6.6) and therefore cannot be easily overridden.

    Cheers, Wojtek

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.