Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Exception on log when trying to view PDF found on search
Hi guys
I built a small site using 7.3.7 CE GA8 and all was going well.
Suddendly I can't view PDFs found through the search page. When I search something, the PDFs come up on the list but when I click on the link, the preview doesn't show up.
On catalina.out, I get these exceptions:
2021-09-10 15:58:36.898 ERROR [http-nio-8080-exec-2][IncludeTag:128] Current URL /group/guest/pesquisa?p_p_id=com_liferay_portal_search_web_search_results_portlet_SearchResultsPortlet&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_com_liferay_portal_search_web_search_results_portlet_SearchResultsPortlet_mvcPath=%2Fview_content.jsp&_com_liferay_portal_search_web_search_results_portlet_SearchResultsPortlet_assetEntryId=37947&_com_liferay_portal_search_web_search_results_portlet_SearchResultsPortlet_type=document&p_l_back_url=%2Fgroup%2Fguest%2Fpesquisa%3Fq%3Dsornar generates exception: java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.jsp.document_005flibrary.info_005fpanel_005ffile_005fentry_jsp._jspService(info_005fpanel_005ffile_005fentry_jsp.java:557)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:368)
at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:380)
at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)
at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:67)
at com.liferay.portal.servlet.DirectRequestDispatcherFactoryImpl$IndirectRequestDispatcher.include(DirectRequestDispatcherFactoryImpl.java:190)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:79)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.taglib.util.IncludeTag.includePage(IncludeTag.java:407)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:383)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:217)
2021-09-10 15:58:36.901 ERROR [http-nio-8080-exec-2][IncludeTag:128] Current URL /group/guest/pesquisa?p_p_id=com_liferay_portal_search_web_search_results_portlet_SearchResultsPortlet&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&_com_liferay_portal_search_web_search_results_portlet_SearchResultsPortlet_mvcPath=%2Fview_content.jsp&_com_liferay_portal_search_web_search_results_portlet_SearchResultsPortlet_assetEntryId=37947&_com_liferay_portal_search_web_search_results_portlet_SearchResultsPortlet_type=document&p_l_back_url=%2Fgroup%2Fguest%2Fpesquisa%3Fq%3Dsornar generates exception: java.lang.NullPointerException
java.lang.NullPointerException
at com.liferay.document.library.web.internal.display.context.logic.DLPortletInstanceSettingsHelper.isShowActions(DLPortletInstanceSettingsHelper.java:121)
at org.apache.jsp.document_005flibrary.view_005ffile_005fentry_jsp._jspService(view_005ffile_005fentry_jsp.java:947)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:368)
at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:380)
at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)
at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:67)
at com.liferay.portal.servlet.DirectRequestDispatcherFactoryImpl$IndirectRequestDispatcher.include(DirectRequestDispatcherFactoryImpl.java:190)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:79)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.taglib.util.IncludeTag.includePage(IncludeTag.java:407)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:383)
When I use the back-office search (through the menu Content / Documents & Media, everything works OK.
Thanks a lot for any ideas
Manuel
EDIT:
I've looked into the source-code at github and, if I'm not mistaken, the problem is that _dlRequestHelper is null ...?
public boolean isShowActions() {
String portletName = _dlRequestHelper.getPortletName(); // Line 121 of the 7.3.7 GA8 version
String portletResource = _dlRequestHelper.getPortletResource();
if (portletName.equals(DLPortletKeys.DOCUMENT_LIBRARY_ADMIN) ||
portletName.equals(PortletKeys.MY_WORKFLOW_TASK) ||
portletResource.equals(DLPortletKeys.DOCUMENT_LIBRARY_ADMIN) ||
portletResource.equals(PortletKeys.MY_WORKFLOW_TASK)) {
return true;
}
DLPortletInstanceSettings dlPortletInstanceSettings =
_dlRequestHelper.getDLPortletInstanceSettings();
return dlPortletInstanceSettings.isShowActions();
}
Am I reading this well? What can I do?
Hi Manuel, 2 questions to start with:
1. Did you add the DLFileEntries for these PDFs programmatically or through the Documents and Media application?
2. What happens if you go into the Search Results widget configurtion and disable Display Selected Result in Context?
Hi Russell,
Thanks for your input.
1. I added these files through the left menu / content / documents & media. I have a page where I display a Documents & Media portlet but it has the "Show actions" checkbox disabled.
2. Disabling "Display Selected Result in Context" or changing any of the other checkboxes doesn't affect the result, unfortunately;
I'm reasonably sure that this was working whan I setup the website and demoed it; this seems to have started only a few days after that, when a coleague was loading more files into the folders.
M
EDIT: I just installed a fresh 7.3 GA8 on my machine, uploaded some documents and the problem is there. I'm no longer sure this problem appeared later. Maybe I didn't test this situation exactly. :-(
About
I added these files through the left menu / content / documents & media. I have a page where I display a Documents & Media portlet but it has the "Show actions" checkbox disabled.
If you re-enable the "show actions" setting, does the issue go away?
Interestingly, it works as expected for me on 7.3.7-ga8. I upload a PDF through the content & Admin > Documents and Media app:
- Test search and preview, and it works.
- Add a D&M widget to a page, enable "show actions" check box. test search and preview, it workls (the acitons buttons are displayed) in the search preview).
- Disable the "show actions" checkbox, search and preview, and it still works (preview shown but no actions buttons in the preview window). This scenario I tested with the default administrative user, another site member user, and as a gues (unauthenticated).
Yes, the D&M Widget works well by itself.
The problem only shows up on the default search page. Apparently when the Search Results Widget tries to delegate the preview action to the D&M widget, it fails.
I've tested with 7.4 GA3 and it works well. It's probably some bug they didn't catch in 7.3. I was hoping someone would have a workaround...
Thanks
Powered by Liferay™