java.lang.UnsupportedOperationException

Liferay Issues | Istvan Dezsi | 2 years ago
  1. 0

    After upgrading to 6.2 and using a different JVM, dynamic rendering of Asset Publisher portlet fails with: 08:13:54,652 ERROR [RuntimePageImpl-332][IncludeTag:129] Current URL /verloning-voordelen-onkosten generates exception: com.liferay.portal.kernel.search.SearchException: java.lang.UnsupportedOperationException java.lang.UnsupportedOperationException at java.util.AbstractList.add(AbstractList.java:148) at java.util.AbstractList.add(AbstractList.java:108) at com.liferay.portlet.assetpublisher.util.AssetSearcher.addSearchAnyCategories(AssetSearcher.java:200) at com.liferay.portlet.assetpublisher.util.AssetSearcher.addSearchAssetCategoryIds(AssetSearcher.java:241) at com.liferay.portal.kernel.search.BaseIndexer.getFullQuery(BaseIndexer.java:235) at com.liferay.portal.kernel.search.BaseIndexer.search(BaseIndexer.java:487) at com.liferay.portlet.asset.util.AssetUtil.search(AssetUtil.java:590) at com.liferay.portlet.asset.util.AssetUtil.search(AssetUtil.java:535) at org.apache.jsp.html.portlet.asset_005fpublisher.view_jsp._jspService(view_jsp.java:1859) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57) at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78) at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53) at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295) at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192) at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83) at org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:3807) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) Based on the exception thrown, it seems that an immutable collection is created and at subsequent renderings we try to add elements to it, hence the unsupported operation exception. The service methods mostly return immutable collections, getSubcategoryIds() is no exception. The code above is broken in a sense that it shouldn't assign the result getSubcategoryIds() to a variable which will be manipulated afterwards.

    Liferay Issues | 2 years ago | Istvan Dezsi
    java.lang.UnsupportedOperationException
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Why SortedList.add() throws UnsupportedOperationException?

    Stack Overflow | 2 years ago | Aubin
    java.lang.UnsupportedOperationException

  1. tvrmsmith 1 times, last 5 days ago
  2. sriharshakiran 1 times, last 7 months ago
  3. Dragos 5 times, last 8 months ago
  4. poroszd 1 times, last 8 months ago
2 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.UnsupportedOperationException

    No message provided

    at java.util.AbstractList.add()
  2. Java RT
    AbstractList.add
    1. java.util.AbstractList.add(AbstractList.java:148)
    2. java.util.AbstractList.add(AbstractList.java:108)
    2 frames
  3. Liferay Portal Service
    BaseIndexer.search
    1. com.liferay.portlet.assetpublisher.util.AssetSearcher.addSearchAnyCategories(AssetSearcher.java:200)
    2. com.liferay.portlet.assetpublisher.util.AssetSearcher.addSearchAssetCategoryIds(AssetSearcher.java:241)
    3. com.liferay.portal.kernel.search.BaseIndexer.getFullQuery(BaseIndexer.java:235)
    4. com.liferay.portal.kernel.search.BaseIndexer.search(BaseIndexer.java:487)
    4 frames
  4. Liferay Portal Impl
    AssetUtil.search
    1. com.liferay.portlet.asset.util.AssetUtil.search(AssetUtil.java:590)
    2. com.liferay.portlet.asset.util.AssetUtil.search(AssetUtil.java:535)
    2 frames
  5. org.apache.jsp
    view_jsp._jspService
    1. org.apache.jsp.html.portlet.asset_005fpublisher.view_jsp._jspService(view_jsp.java:1859)
    1 frame
  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:728)
    1 frame
  8. Liferay Portal Impl
    ClassLoaderRequestDispatcherWrapper.include
    1. com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
    2. com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
    3. com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
    3 frames
  9. Liferay Util Taglib
    IncludeTag.doEndTag
    1. com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
    2. com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
    3. com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83)
    3 frames
  10. org.apache.jsp
    portlet_jsp._jspService
    1. org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:3807)
    1 frame
  11. GWT dev
    HttpJspBase.service
    1. org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    1 frame
  12. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    1 frame