Foros de discusión

Document Library Null Pointer on recent and new documents

Christopher E, modificado hace 12 años.

Document Library Null Pointer on recent and new documents

Junior Member Mensajes: 33 Fecha de incorporación: 9/08/11 Mensajes recientes
Hi there,
when I select the link Recent Documents or New Documents in the document library portlet I get the list of the new or recent documents. So far so good. But when I try to click on a document to see the detail view of a document I get a Null Pointer Exception like this (in Liferay version: 6.0.6):

16:27:15,630 ERROR [IncludeTag:231] Current URL /en/web/hallo-weltdrei/menu-1?p_p_id=20&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-2&p_p_col_count=6&_20_struts_action=%2Fdocument_library%2Fview_file_entry&_20_redirect=http%3A%2F%2Flocalhost%3A8080%2Fen%2Fweb%2Fhallo-weltdrei%2Fmenu-1%2F-%2Fdocument_library%2Frecent-documents&_20_fileEntryId=22409 generates exception: An exception occurred processing JSP page /html/portlet/document_library/view_file_entry.jsp at line 30

27:
28: DLFileEntry fileEntry = (DLFileEntry)request.getAttribute(WebKeys.DOCUMENT_LIBRARY_FILE_ENTRY);
29:
30: fileEntry = fileEntry.toEscapedModel();
31:
32: long fileEntryId = fileEntry.getFileEntryId();
33: long folderId = fileEntry.getFolderId();


Stacktrace:
16:27:15,632 ERROR [IncludeTag:154] java.lang.NullPointerException
at org.apache.jsp.html.portlet.document_005flibrary.view_005ffile_005fentry_jsp._jspService(view_005ffile_005fentry_jsp.java:1133)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:175)
at com.liferay.taglib.util.IncludeTag._doInclude(IncludeTag.java:223)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:58)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

This exception is identical to the one in found in the Liferay Ticket System:
http://issues.liferay.com/browse/LPS-20339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel#issue-tabs

But the solution I found on this ticket does not help in any way and referes to the document search.
Does anybody have any suggestions on that?

greetings and thanks Chris
thumbnail
Shantanu Puranik, modificado hace 12 años.

RE: Document Library Null Pointer on recent and new documents

Junior Member Mensajes: 34 Fecha de incorporación: 21/01/11 Mensajes recientes
I'm facing the same issue with link Recent Documents.
Any fix for this in 6.0.6?
Thanks.
thumbnail
Shantanu Puranik, modificado hace 12 años.

RE: Document Library Null Pointer on recent and new documents

Junior Member Mensajes: 34 Fecha de incorporación: 21/01/11 Mensajes recientes
Well, got this working using the fix mentioned in the ticket.

For searched documents add following two lines of code in search.jsp after line 139

rowURL.setParameter("name", fileEntry.getName());
rowURL.setParameter("folderId", String.valueOf(fileEntry.getFolderId()));


For Recent Documents add following two lines of code in view.jsp after line 288

viewFileEntryURL.setParameter("name", fileEntry.getName());
viewFileEntryURL.setParameter("folderId", String.valueOf(fileEntry.getFolderId()));