cancel
Showing results for 
Search instead for 
Did you mean: 

Getting 'Internal server error' while clicking on Administration tab in editor view in backoffice.

Former Member
0 Kudos

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 :

 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:?]

View Entire Topic
0 Kudos

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ł

0 Kudos

We might backport it in the future but we can't promise that we will patch it during 6.6 development.

Former Member
0 Kudos

Hello , Thanks for the reply. But I am unable to find this file 'SavedValuesLabelProvider' in any of the extensions (including platformbackoffice/platform) in hybris6.1 ,hence I am not able to implement the above mentioned fix . Could you please help me?

0 Kudos

there might be a problem in how classpaths are defined in the project. Could you manually add a platformbackoffice_bof.jar located in hybris/bin/ext-platform-backoffice/platformbackoffice/resources/backoffice to your project? This class is located there.

Former Member
0 Kudos

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.

Former Member
0 Kudos

, On checking further i can see a number of entries in SavedValues table with null user field. Would that be the root cause of the issue . Could you suggest if any issue in the save logic.