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

Overriding portlets with atom collector adapter in liferay-portlet-ext.xml causes NPE

    Details

      Description

      I have used the liferay-portlet-ext.xml to override one of the core portlets : 20 (document library). However, if I do it this way a duplicate atom collector adapter is detected and the entire startup process aborts with no portlets being initialised.

      It seems that any core portlet with an atom collector adapter can no longer be overriden with an alternative configuration in liferay-portlet-ext.xml within an ext-plugin project.

      Stack dump:
      com.liferay.portal.kernel.atom.AtomException: Duplicate collection name files
      at com.liferay.portal.atom.AtomCollectionAdapterRegistryImpl.register(AtomCollectionAdapterRegistryImpl.java:48)
      at com.liferay.portal.kernel.atom.AtomCollectionAdapterRegistryUtil.register(AtomCollectionAdapterRegistryUtil.java:49)
      at com.liferay.portlet.PortletBagFactory.newAtomCollectionAdapterInstances(PortletBagFactory.java:611)
      at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:205)
      at com.liferay.portal.servlet.MainServlet.initPortlets(MainServlet.java:928)
      at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:256)
      at javax.servlet.GenericServlet.init(GenericServlet.java:160)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5123)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5407)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
      at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
      at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1673)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      at java.lang.Thread.run(Thread.java:662)

      Addition to liferay-portlet-ext.xml:

      • doc_library portlet with ajaxable turned off

      <portlet>
      <portlet-name>20</portlet-name>
      <icon>/html/icons/document_library.png</icon>
      <struts-path>document_library</struts-path>
      <configuration-action-class>com.liferay.portlet.documentlibrary.action.ConfigurationActionImpl</configuration-action-class>
      <indexer-class>com.liferay.portlet.documentlibrary.util.DLIndexer</indexer-class>
      <open-search-class>com.liferay.portlet.documentlibrary.util.DLOpenSearchImpl</open-search-class>
      <portlet-url-class>com.liferay.portal.struts.StrutsActionPortletURL</portlet-url-class>
      <portlet-data-handler-class>com.liferay.portlet.documentlibrary.lar.DLPortletDataHandlerImpl</portlet-data-handler-class>
      <social-activity-interpreter-class>com.liferay.portlet.documentlibrary.social.DLActivityInterpreter</social-activity-interpreter-class>
      <webdav-storage-token>document_library</webdav-storage-token>
      <webdav-storage-class>com.liferay.portlet.documentlibrary.webdav.DLWebDAVStorageImpl</webdav-storage-class>
      <control-panel-entry-category>content</control-panel-entry-category>
      <control-panel-entry-weight>12.0</control-panel-entry-weight>
      <asset-renderer-factory>com.liferay.portlet.documentlibrary.asset.DLFileEntryAssetRendererFactory</asset-renderer-factory>
      <atom-collection-adapter>com.liferay.portlet.documentlibrary.atom.FileEntryAtomCollectionAdapter</atom-collection-adapter>
      <atom-collection-adapter>com.liferay.portlet.documentlibrary.atom.FolderAtomCollectionAdapter</atom-collection-adapter>
      <custom-attributes-display>com.liferay.portlet.documentlibrary.DLFileEntryCustomAttributesDisplay</custom-attributes-display>
      <custom-attributes-display>com.liferay.portlet.documentlibrary.DLFolderCustomAttributesDisplay</custom-attributes-display>
      <workflow-handler>com.liferay.portlet.documentlibrary.workflow.DLFileEntryWorkflowHandler</workflow-handler>
      <preferences-owned-by-group>true</preferences-owned-by-group>
      <use-default-template>false</use-default-template>
      <scopeable>true</scopeable>
      <private-request-attributes>false</private-request-attributes>
      <private-session-attributes>false</private-session-attributes>
      <render-weight>50</render-weight>
      <ajaxable>false</ajaxable>
      <header-portlet-css>/html/portlet/document_library/css/main.css</header-portlet-css>
      <header-portlet-css>/html/portlet/dynamic_data_mapping/css/main.css</header-portlet-css>
      <footer-portal-javascript>/html/js/liferay/service.js</footer-portal-javascript>
      <footer-portlet-javascript>/html/portlet/dynamic_data_lists/js/main.js</footer-portlet-javascript>
      <footer-portlet-javascript>/html/portlet/dynamic_data_mapping/js/main.js</footer-portlet-javascript>
      <footer-portlet-javascript>/html/portlet/document_library/js/main.js</footer-portlet-javascript>
      <css-class-wrapper>portlet-document-library</css-class-wrapper>
      <add-default-resource>true</add-default-resource>
      </portlet>

        Attachments

          Activity

            People

            Assignee:
            michael.saechang Michael Saechang
            Reporter:
            cschaefer21 Craig Schaefer (Inactive)
            Participants of an Issue:
            Recent user:
            Esther Sanz
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              7 years, 11 weeks, 3 days ago

                Packages

                Version Package