cancel
Showing results for 
Search instead for 
Did you mean: 

An error when preview images added in the Files tab

adam_bo_
Star Contributor
Star Contributor

When the file document is created without a file blob and after some images are added in the Files tab, then the preview functionality does not work for them. The error following error is logged:

2017-05-29 14:24:22,906 ERROR [http-bio-192.168.31.72-8083-exec-28] [nuxeo-error-log] java.lang.NullPointerException
	at org.nuxeo.ecm.platform.pictures.tiles.serializer.JSONPictureTilesSerializer.serialize(JSONPictureTilesSerializer.java:44)
	at org.nuxeo.ecm.platform.pictures.tiles.restlets.PictureTilesRestlets.handleSendInfo(PictureTilesRestlets.java:194)
	at org.nuxeo.ecm.platform.pictures.tiles.restlets.PictureTilesRestlets.handle(PictureTilesRestlets.java:136)
	at org.nuxeo.ecm.platform.ui.web.restAPI.ThreadSafeRestletFilter.doHandle(ThreadSafeRestletFilter.java:56)

The problem is created by an url address send to the PictureTilesRestlets: http://localhost:8080/nuxeo/restAPI/getTiles/default/a27f4a36-447f-4ce1-aff9-5a74115aa3d3/64/64/3?fo... but it expects the format (as is in restAPI-contrib.xml): /nuxeo/restAPI/getTiles/{repoId}/{docId}/{tileWidth}/{tileHeight}/{maxTiles}?fieldPath=(subPath)&x=(tileX)&y=(tileY)&format=(XML|JSON)

In consequence, the following code returns a null value for xpath:

        Form form = req.getResourceRef().getQueryAsForm();
        String xpath = (String) form.getFirstValue("fieldPath");

and an adapter have a null xpath:

            adapter = getFromCache(targetDocument, xpath);
            if (adapter == null) {
                adapter = targetDocument.getAdapter(PictureTilesAdapter.class);

If a file document is created with an image and after some images are added by the Files tab, then every preview shows the same main picture,

nxpreviewerror.jpg

All the best

5 REPLIES 5

Florent_Guillau
World-Class Innovator
World-Class Innovator

Thanks for the report. What is it that you call "the preview functionality"? Which part of which UI are you using?

adam_bo_
Star Contributor
Star Contributor

I have updated the report and included a picture where is pointed the icon called by me "the preview functionality"

Florent_Guillau
World-Class Innovator
World-Class Innovator

I can't reproduce. Is your image of a special type or size?

adam_bo_
Star Contributor
Star Contributor

It is a normal jpeg file. Nuxeo with the DAM addon. Steps

adam_bo_
Star Contributor
Star Contributor

I have attached an example image "P3140005.JPG" that creates a problem. "WidthThreshold"=1200 and "HeightThreshold"=1200

Getting started

Attention: Blogs & Forums are in READ-ONLY mode from Oct 9-19 as we transition to our new platform. Learn more.

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.