com.liferay.portlet.asset.NoSuchCategoryException: No AssetCategory exists with the primary key 10439

Liferay Issues | Jose Jimenez | 4 years ago
  1. 0

    If you invoke the Asset Categories Selector with not existent CategoryIds as curCategoryIds, it's thrown an exception and is not renderized. See attached sample portlet that invokes the component with invented categoryIds. Exception: 14:45:21,331 ERROR [http-bio-8080-exec-5][IncludeTag:253] Current URL /en/web/guest/home?p_p_id=86&p_p_lifecycle=0&p_p_state=pop_up&p_p_col_id=column-1&p_p_col_count=5&_86_struts_action=%2Fportlet_configuration%2Fedit_configuration&_86_redirect=%2Fen%2Fweb%2Fguest%2Fhome&_86_returnToFullPageURL=%2Fen%2Fweb%2Fguest%2Fhome&_86_portletResource=101_INSTANCE_35d6KLgasCQJ&_86_resourcePrimKey=10183_LAYOUT_101_INSTANCE_35d6KLgasCQJ&_86_ generates exception: Array index out of range: -1 14:45:21,332 ERROR [http-bio-8080-exec-5][IncludeTag:154] java.lang.ArrayIndexOutOfBoundsException: Array index out of range: -1 at com.liferay.portal.kernel.util.StringBundler.setIndex(StringBundler.java:186) at org.apache.jsp.html.taglib.ui.asset_005fcategories_005fselector.page_jsp._getCategoryIdsTitles(page_jsp.java:271) at org.apache.jsp.html.taglib.ui.asset_005fcategories_005fselector.page_jsp._jspService(page_jsp.java:770) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97) at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90) at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54) at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:345) at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:245) at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:86) at org.apache.jsp.html.portlet.asset_005fpublisher.edit_005fquery_005frule_jsp._jspService(edit_005fquery_005frule_jsp.java:981) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97) at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90) at com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54) at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:345) at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:245) at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:86)

    Liferay Issues | 4 years ago | Jose Jimenez
    com.liferay.portlet.asset.NoSuchCategoryException: No AssetCategory exists with the primary key 10439

    Root Cause Analysis

    1. com.liferay.portlet.asset.NoSuchCategoryException

      No AssetCategory exists with the primary key 10439

      at com.liferay.portlet.asset.service.persistence.AssetCategoryPersistenceImpl.findByPrimaryKey()
    2. Liferay Portal Service
      AssetCategoryPersistenceImpl.findByPrimaryKey
      1. com.liferay.portlet.asset.service.persistence.AssetCategoryPersistenceImpl.findByPrimaryKey(AssetCategoryPersistenceImpl.java:908)
      1 frame
    3. Liferay Portal Impl
      ServiceBeanAopProxy.invoke
      1. com.liferay.portlet.asset.service.impl.AssetCategoryLocalServiceImpl.getCategory(AssetCategoryLocalServiceImpl.java:250)
      2. com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122)
      3. com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71)
      4. com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
      5. com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
      6. com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
      7. com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
      8. com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
      9. com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
      10. com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
      11. com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:57)
      12. com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118)
      13. com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
      13 frames
    4. Liferay Portal Service
      AssetCategoryLocalServiceUtil.getCategory
      1. com.liferay.portlet.asset.service.AssetCategoryLocalServiceUtil.getCategory(AssetCategoryLocalServiceUtil.java:364)
      1 frame
    5. org.apache.jsp
      page_jsp._jspService
      1. org.apache.jsp.html.taglib.ui.asset_005fcategories_005fselector.page_jsp._getCategoryIdsTitles(page_jsp.java:254)
      2. org.apache.jsp.html.taglib.ui.asset_005fcategories_005fselector.page_jsp._jspService(page_jsp.java:761)
      2 frames
    6. GWT dev
      HttpJspBase.service
      1. org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      1 frame
    7. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      1 frame
    8. Liferay Portal Impl
      DirectRequestDispatcher.include
      1. com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97)
      1 frame