on 09-11-2017 2:47 PM
We are getting an 'Internal server error' while clicking on 'Administration' tab in editor view in backoffice, hybris 6.1 . This error is occurring intermittently for various entities in backoffice in different environments. Could you please provide a direction to debug this further.
PFB the error :
[m java.lang.NullPointerException: while trying to invoke the method de.hybris.platform.core.model.user.UserModel.getDisplayName() of a null object returned from de.hybris.platform.hmc.model.SavedValuesModel.getUser() at de.hybris.platform.platformbackoffice.labelproviders.SavedValuesLabelProvider.getLabel(SavedValuesLabelProvider.java:42) ~[?:?] at de.hybris.platform.platformbackoffice.labelproviders.SavedValuesLabelProvider.getLabel(SavedValuesLabelProvider.java:1) ~[?:?] at com.hybris.cockpitng.labels.impl.DefaultLabelService.getObjectLabel(DefaultLabelService.java:85) ~[cockpitcore-2.5.4-RC1.jar:?]
Hello Aswathy,
SavedValuesLabelProvider was indeed prone to NullPointerException and the fix will be included in 6.6.
For the quick fix I would extend the SavedValuesLabelProvider, override the #getLabel(final SavedValuesModel savedValues)
and register it as a bean instead default provider. In this method you can add the nullcheck:
final UserModel user = savedValues.getUser();
final String changedByValue = user != null ? user.getDisplayName() : null;
I will figure out if there are plans for backporting this issue and get back to you.
Best regards, Michał
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks , I did the same suggested and was able to get the expected results . But to deploy in production it would be difficult to add platformbackoffice_bof.jar in class path . Hence i was looking at option to write an independent labelprovider for the purpose,but i am not sure of the logic in the remaining methods. Could you please share the 'SavedValuesLabelProvider' java file so that i can implement the same.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.