Expand my Community achievements bar.

SOLVED

AEM 6.5 getTranslationObjectPreview returns null on starting all project jobs

Avatar

Level 2

Hello,

 

com.adobe.granite.translation.api.TranslationObject#getTranslationObjectPreview is behaving inconsistently upon starting a translation job.

 

When I start a translation job in a translation project using the job tile dropdown, it returns the stream as expected.

 

However, when I select the translation project tile and click 'Start Translation Job(s)' the method returns null.

 

This happens regardless of content (tested with multiple different We.Retail pages) and amount of jobs. 

 

log:

 

31.08.2020 09:19:59.317 *ERROR* [172.17.0.1 [1598865596673] POST /libs/cq/gui/components/projects/admin/translation HTTP/1.1] com.adobe.cq.wcm.translation.impl.TranslationObjectImpl Error while generating preview {}
java.lang.NullPointerException: null
	at com.adobe.cq.wcm.translation.impl.TranslationObjectImpl.getPreviewResourceResolver(TranslationObjectImpl.java:1840) [com.day.cq.wcm.cq-wcm-translation:1.5.58]
	at com.adobe.cq.wcm.translation.impl.TranslationObjectImpl.getTranslationObjectPreviewFileInputStream(TranslationObjectImpl.java:1832) [com.day.cq.wcm.cq-wcm-translation:1.5.58]
	at com.adobe.cq.wcm.translation.impl.TranslationObjectImpl.getTranslationObjectPreview(TranslationObjectImpl.java:1846) [com.day.cq.wcm.cq-wcm-translation:1.5.58]
...

 

1 Accepted Solution

Avatar

Correct answer by
Employee

First check that this service user exists : translation-preview

 

Second to that, log a ticket with Customer Care.  

 

Quick inspection of the source code, the resolverFactory has got to be the null object...

 

It's trying to get the resource resolver for the above service user : 

 

resolverFactory.getServiceResourceResolver(Collections.singletonMap( ResourceResolverFactory.SUBSERVICE, (Object) new String(TranslationUtils.TRANSLATION_PREVIEW_SERVICE_USER)));

 

There are getter/setter methods for the factory, so presumably however you're invoking the preview it's not calling the setter beforehand.

 

Please log a ticket with clear steps to reproduce

 

~Marc

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

First check that this service user exists : translation-preview

 

Second to that, log a ticket with Customer Care.  

 

Quick inspection of the source code, the resolverFactory has got to be the null object...

 

It's trying to get the resource resolver for the above service user : 

 

resolverFactory.getServiceResourceResolver(Collections.singletonMap( ResourceResolverFactory.SUBSERVICE, (Object) new String(TranslationUtils.TRANSLATION_PREVIEW_SERVICE_USER)));

 

There are getter/setter methods for the factory, so presumably however you're invoking the preview it's not calling the setter beforehand.

 

Please log a ticket with clear steps to reproduce

 

~Marc

Avatar

Level 2

Hello Marc, thanks for your advice.

 

I checked and there is a service user called 'translation-preview-service', but no user called 'translation-preview'.

Is that equivalent, or does it need to be exactly 'translation-preview'?