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

NullPointerException at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.updateFileEntry(DLFileEntryLocalServiceImpl.java:893

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Duplicate
    • Affects Version/s: 5.2.3
    • Fix Version/s: None
    • Component/s: Legacy
    • Labels:
      None
    • Liferay Contributor's Agreement:
      Accept

      Description

      When using DLFileEntryServiceUtil.updateFileEntry(fileEntry.getFolderId(), newFolderId, fileEntry.getName(), fileEntry.getName(), fileEntry.getTitle(), fileEntry.getDescription(), fileEntry.getExtraSettings(), bytes, serviceContext); I get the below Exception.

      [#|2010-04-07T14:22:15.632-0400|SEVERE|glassfishv3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=27;_ThreadName=Thread-1;|java.lang.NullPointerException
      at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.updateFileEntry(DLFileEntryLocalServiceImpl.java:893)
      at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryLocalServiceImpl.updateFileEntry(DLFileEntryLocalServiceImpl.java:751)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      at $Proxy207.updateFileEntry(Unknown Source)
      at com.liferay.portlet.documentlibrary.service.impl.DLFileEntryServiceImpl.updateFileEntry(DLFileEntryServiceImpl.java:290)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      at $Proxy208.updateFileEntry(Unknown Source)
      at com.liferay.portlet.documentlibrary.service.DLFileEntryServiceUtil.updateFileEntry(DLFileEntryServiceUtil.java:153)
      at com.krfs.webportal.DocumentManager.approveDocument(DocumentManager.java:171)
      at org.apache.jsp.documentApprover_005fview_jsp._jspService(documentApprover_005fview_jsp.java from :289)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:406)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:483)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:373)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
      at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:802)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:664)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:619)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:549)
      at com.liferay.portlet.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:307)
      at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:122)
      at com.sample.jsp.portlet.JSPPortlet.include(JSPPortlet.java:109)
      at com.sample.jsp.portlet.JSPPortlet.doView(JSPPortlet.java:89)
      at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)
      at com.sample.jsp.portlet.JSPPortlet.doDispatch(JSPPortlet.java:62)
      at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
      at com.sun.portal.portletcontainer.appengine.filter.FilterChainImpl.doFilter(FilterChainImpl.java:126)
      at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:69)
      at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:100)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
      at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:802)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:664)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:619)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:549)
      at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:618)
      at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:700)
      at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:419)
      at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java from :1445)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:406)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:483)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:373)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
      at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:802)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:664)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:619)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:549)
      at com.liferay.portal.util.PortalImpl.renderPortlet(PortalImpl.java:2884)
      at com.liferay.portal.util.PortalUtil.renderPortlet(PortalUtil.java:897)
      at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processPortlet(RuntimePortletUtil.java:170)
      at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processPortlet(RuntimePortletUtil.java:103)
      at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processTemplate(RuntimePortletUtil.java:281)
      at com.liferay.portlet.layoutconfiguration.util.RuntimePortletUtil.processTemplate(RuntimePortletUtil.java:190)
      at org.apache.jsp.html.portal.layout.view.portlet_jsp._jspService(portlet_jsp.java from :826)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:406)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:483)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:373)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
      at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:802)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:664)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:619)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:549)
      at com.liferay.portal.action.LayoutAction.includeLayoutConte|#]

      The issue is variable stats being null. Below is the code fragment:
      RatingsStats stats = ratingsStatsPersistence.fetchByC_C(
      classNameId, oldFileEntryId);

      stats.setClassPK(newFileEntryId);

      ratingsStatsPersistence.update(stats, false);

      List<RatingsEntry> entries = ratingsEntryPersistence.findByC_C(
      classNameId, oldFileEntryId);

      for (RatingsEntry entry : entries)

      { entry.setClassPK(newFileEntryId); ratingsEntryPersistence.update(entry, false); }

      I tried surrounding the code with if(stats != null){ but unfortunately I get too much "... does not exist" when I try to build portal-impl.jar

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                support-lep@liferay.com SE Support
                Reporter:
                nestoru Nestor Urquiza (Inactive)
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  7 years, 29 weeks, 4 days ago