<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>NullPointerException on getBaseModelDocument in liferay 7. 4 ga10 ce</title>
  <link rel="self" href="https://liferay.dev/fi/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121423006" />
  <subtitle>NullPointerException on getBaseModelDocument in liferay 7. 4 ga10 ce</subtitle>
  <id>https://liferay.dev/fi/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121423006</id>
  <updated>2026-05-18T02:50:50Z</updated>
  <dc:date>2026-05-18T02:50:50Z</dc:date>
  <entry>
    <title>NullPointerException on getBaseModelDocument in liferay 7. 4 ga10 ce</title>
    <link rel="alternate" href="https://liferay.dev/fi/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121423005" />
    <author>
      <name>Muhammad Saleh</name>
    </author>
    <id>https://liferay.dev/fi/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121423005</id>
    <updated>2022-05-16T15:55:03Z</updated>
    <published>2022-05-16T09:54:38Z</published>
    <summary type="html">&lt;p&gt;Actually I am doing indexing with embedded elasticsearch but when my
  indexer class calls doGetDocument method and it invokes the
  getBaseModelDocument it is returning null with these logs&lt;/p&gt;
&lt;p&gt;java.lang.NullPointerException: null&lt;br /&gt;     at
  com.liferay.portal.search.internal.spi.model.index.contributor.StagingDocumentContributor.contribute(StagingDocumentContributor.java:52)
  ~[?:?]&lt;br /&gt;     at
  com.liferay.portal.kernel.search.BaseIndexer.getBaseModelDocument(BaseIndexer.java:1257)
  ~[portal-kernel.jar:?]&lt;br /&gt;     at com.liferay.portal.kernel.search.BaseIndexer.getBaseModelDocument(BaseIndexer.java:1196)&lt;/p&gt;
&lt;pre&gt;
&lt;code class="language-java"&gt;protected Document doGetDocument(EntityName object) throws Exception {
    Document document = null;
    try {
         document = getBaseModelDocument(getPortletId(),object);

    }catch (Exception e)
    {
        logger.error(e);
    }

    return document;
}&lt;/code&gt;&lt;/pre&gt;</summary>
    <dc:creator>Muhammad Saleh</dc:creator>
    <dc:date>2022-05-16T09:54:38Z</dc:date>
  </entry>
</feed>
