Wednesday, February 4, 2015

Liferay 6.2 - Unable to download DL documents


Liferay 6.2 - Unable to download DL documents

________________________________________________________________________________
Description:

Documents are available in DL, and there are appropriate files in /data/document_library folder, but download link is broken. When accessing link, like:

http://domain.com/documents/279794/304265/doc.xml/29d62ab3-c587-4a4e-9346-f9c9388430a2

such error is shown:


However, when accessing the same document using host:port URL, like:

http://host:port/documents/279794/304265/doc.xml/29d62ab3-c587-4a4e-9346-f9c9388430a2

files are downloaded successfully.


________________________________________________________________________________
Fix:

Patch com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter class:

(line 290):
/*forwardURL.append(_PRIVATE_GROUP_SERVLET_MAPPING);*/
/*patch:*/
if (isDocumentFriendlyURL(
        request, group.getGroupId(), friendlyURL)) {

    processFilter(
            VirtualHostFilter.class, request, response,
            filterChain);

    return;
}
else {
    forwardURL.append(_PRIVATE_GROUP_SERVLET_MAPPING);
}
/*patch:*/


Compile it, and place into /ROOT/WEB-INF/classes directory. Restart Liferay.
________________________________________________________________________________
More info:

1. Jira issue
2. Liferay form thread

2 comments:

  1. Hi vital i am getting same issue like above NOT Found error.
    I am using the liferay-portal-6.2-ce-ga6 version.
    Please let me know how i want to build the VirtualHostFilter file as you mentioned in above post.

    ReplyDelete