Template rendering : null mime-type error

Hi,

I'm trying to render a document with a docx template using Freemarker, but I got the following error :

org.nuxeo.ecm.core.convert.api.ConversionException: Failed to invoke operation Blob.RunConverter, null mime type not supported by any2pdf converter

at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:323) ~[nuxeo-core-convert-10.10.jar:?]
at org.nuxeo.ecm.automation.core.operations.blob.RunConverter.run(RunConverter.java:66) ~[nuxeo-automation-core-10.10.jar:?]

My guess is that the TemplateProcessor.Render operation returns a blob with no mime type, but I can't really see why.

You can see where the error is thrown here

Any help appreciated !

0 votes

0 answers

81 views

ANSWER

I think the problem might happen here : https://github.com/nuxeo/nuxeo/blob/82585cb126952e59c7ee0208f5ee1b79f7a38e6e/modules/platform/nuxeo-template-rendering/nuxeo-template-rendering-core/src/main/java/org/nuxeo/template/adapters/doc/TemplateBasedDocumentAdapterImpl.java#L242

The default value is null so if it can't get the mime type from the file name it will set it to null. But how do I avoid this ?

07/28/2020