Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-54125

Knowledge Base Article attachments that exceed maxfilesize generate NPE

    Details

    • Type: Regression Bug
    • Status: Verified
    • Resolution: Unresolved
    • Affects Version/s: 6.2.10 EE GA1, 6.2.X EE
    • Fix Version/s: None
    • Component/s: Knowledge Base

      Description

      A Null Pointer Exception is generated when attaching a file to a Knowledge Base Article that exceeds the maximum file size.

      Steps to Reproduce:

      1. Go to Admin, Content, Knowledge Base
      2. Select Add Article
      3. Enter Title, Content
      4. Add Attachment (exceeding 100mb in size) - the NPE is generated in console
      5. Select Publish

      Expected Result: A warning is generated that the file exceeds the maximum size, no error in console.

      Actual Result: Attachment is not added, NPE is generated in console, and article fails to publish.

      18:51:21,896 ERROR [http-bio-8080-exec-6][render_portlet_jsp:132] null
      java.lang.NullPointerException
              at com.liferay.portal.util.MimeTypesImpl.getContentType(MimeTypesImpl.java:84)
              at com.liferay.portal.kernel.util.MimeTypesUtil.getContentType(MimeTypesUtil.java:39)
              at com.liferay.portal.upload.UploadPortletRequestImpl.getContentType(UploadPortletRequestImpl.java:70)
              at com.liferay.knowledgebase.portlet.BaseKBPortlet.addTempAttachment(BaseKBPortlet.java:100)
              at com.liferay.compat.portal.kernel.portlet.LiferayPortlet.callActionMethod(LiferayPortlet.java:157)
              at com.liferay.compat.util.bridges.mvc.MVCPortlet.callActionMethod(MVCPortlet.java:249)
              at com.liferay.compat.portal.kernel.portlet.LiferayPortlet.processAction(LiferayPortlet.java:84)
              at com.liferay.compat.util.bridges.mvc.MVCPortlet.processAction(MVCPortlet.java:212)
              at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:71)
              at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:48)
              at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:112)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
              at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
      18:54:12,258 ERROR [http-bio-8080-exec-3][PortletServlet:116] javax.portlet.PortletException: java.lang.NullPointerException
      javax.portlet.PortletException: java.lang.NullPointerException
              at com.liferay.compat.portal.kernel.portlet.LiferayPortlet.callActionMethod(LiferayPortlet.java:175)
              at com.liferay.compat.util.bridges.mvc.MVCPortlet.callActionMethod(MVCPortlet.java:249)
              at com.liferay.compat.portal.kernel.portlet.LiferayPortlet.processAction(LiferayPortlet.java:84)
              at com.liferay.compat.util.bridges.mvc.MVCPortlet.processAction(MVCPortlet.java:212)
              at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:71)
              at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:48)
              at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:112)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
              at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
              at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
              at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:604)
      

      The full console output is avaialble here.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                3 years, 8 weeks ago

                Packages

                Version Package