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

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 10426

    Root Cause Analysis

    1. com.liferay.portlet.asset.NoSuchCategoryException

      No AssetCategory exists with the primary key 10426

      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:945)
      1 frame
    3. Liferay Portal Impl
      ServiceBeanAopProxy.invoke
      1. com.liferay.portlet.asset.service.base.AssetCategoryLocalServiceBaseImpl.getAssetCategory(AssetCategoryLocalServiceBaseImpl.java:240)
      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.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211)
      5 frames
    4. Liferay Portal Service
      AssetCategoryLocalServiceUtil.getAssetCategory
      1. com.liferay.portlet.asset.service.AssetCategoryLocalServiceUtil.getAssetCategory(AssetCategoryLocalServiceUtil.java:185)
      1 frame
    5. org.apache.jsp
      view_jsp._jspService
      1. org.apache.jsp.html.portlet.asset_005fpublisher.view_jsp.getAddPortletURL(view_jsp.java:304)
      2. org.apache.jsp.html.portlet.asset_005fpublisher.view_jsp.getAddPortletURLs(view_jsp.java:369)
      3. org.apache.jsp.html.portlet.asset_005fpublisher.view_jsp._jspService(view_jsp.java:988)
      3 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
      PACLRequestDispatcherWrapper.include
      1. com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:97)
      2. com.liferay.portal.servlet.PACLRequestDispatcherWrapper.doDispatch(PACLRequestDispatcherWrapper.java:90)
      3. com.liferay.portal.servlet.PACLRequestDispatcherWrapper.include(PACLRequestDispatcherWrapper.java:54)
      3 frames
    9. Liferay Util Taglib
      IncludeTag.doEndTag
      1. com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:345)
      2. com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:245)
      3. com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:86)
      3 frames
    10. org.apache.jsp
      portlet_jsp._jspService
      1. org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:3808)
      1 frame
    11. GWT dev
      HttpJspBase.service
      1. org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      1 frame