Exception on log when trying to view PDF found on searchException on log when trying to view PDF found on searchhttps://liferay.dev/c/message_boards/find_thread?p_l_id=119785333&threadId=1211388152024-03-29T01:35:40Z2024-03-29T01:35:40ZRE: Exception on log when trying to view PDF found on searchManuel Castrohttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1211453952021-09-13T18:43:33Z2021-09-13T18:43:32Z<p>Yes, the D&M Widget works well by itself.</p>
<p>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.</p>
<p>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...</p>
<p>Thanks</p>Manuel Castro2021-09-13T18:43:32ZRE: RE: Exception on log when trying to view PDF found on searchRussell Bohlhttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1211450032021-09-13T13:15:32Z2021-09-13T13:15:32Z<p>Interestingly, it works as expected for me on 7.3.7-ga8. I upload a
PDF through the content & Admin > Documents and Media app:</p>
<ol>
<li>Test search and preview, and it works.</li>
<li>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).</li>
<li>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).</li></ol>
<p> </p>Russell Bohl2021-09-13T13:15:32ZRE: RE: Exception on log when trying to view PDF found on searchRussell Bohlhttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1211449642021-09-13T12:25:14Z2021-09-13T12:25:13Z<p>About </p>
<blockquote>
<p> 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.</p></blockquote>
<p>If you re-enable the "show actions" setting, does the issue
go away?</p>Russell Bohl2021-09-13T12:25:13ZRE: Exception on log when trying to view PDF found on searchManuel Castrohttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1211445012021-09-13T09:01:25Z2021-09-13T07:31:54Z<p>Hi Russell,</p>
<p>Thanks for your input.</p>
<p>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.</p>
<p>2. Disabling "Display Selected Result in Context" or
changing any of the other checkboxes doesn't affect the result, unfortunately;</p>
<p>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.</p>
<p>M</p>
<p> </p>
<p>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. :-(</p>
<p> </p>Manuel Castro2021-09-13T07:31:54ZRE: Exception on log when trying to view PDF found on searchRussell Bohlhttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1211390892021-09-13T11:39:07Z2021-09-10T19:38:45Z<p>Hi Manuel, 2 questions to start with:</p>
<p>1. Did you add the DLFileEntries for these PDFs programmatically or
through the Documents and Media application?</p>
<p>2. What happens if you go into the Search Results widget configurtion
and disable <em>Display Selected Result in Context</em>?</p>Russell Bohl2021-09-10T19:38:45ZException on log when trying to view PDF found on searchManuel Castrohttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1211388142021-09-10T17:02:24Z2021-09-10T16:09:46Z<p>Hi guys</p>
<p>I built a small site using 7.3.7 CE GA8 and all was going well. </p>
<p>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. </p>
<p>On catalina.out, I get these exceptions:</p>
<pre>
<code>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)
</code></pre>
<p> </p>
<p>When I use the back-office search (through the menu Content /
Documents & Media, everything works OK. </p>
<p>Thanks a lot for any ideas</p>
<p>Manuel</p>
<p>EDIT:</p>
<p>I've looked into the source-code at github and, if I'm not mistaken,
the problem is that _dlRequestHelper is null ...?</p>
<pre>
<code class="language-java">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 dlPortletInstanceSett