An error when preview images added in the Files tab

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-] [nuxeo-error-log] java.lang.NullPointerException
    at org.nuxeo.ecm.platform.ui.web.restAPI.ThreadSafeRestletFilter.doHandle(

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?format=json 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,


All the best

0 votes

0 answers



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

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

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

It is a normal jpeg file. Nuxeo with the DAM addon. Steps: 1. create a file document (without attaching any file), 2. in the new document go to the Files tab and add the image, 3. try to preview the image.

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