<?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>Multiple Organization creation Process takes time</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114831277" />
  <subtitle>Multiple Organization creation Process takes time</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114831277</id>
  <updated>2026-04-05T22:14:29Z</updated>
  <dc:date>2026-04-05T22:14:29Z</dc:date>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115049893" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115049893</id>
    <updated>2019-08-31T05:14:57Z</updated>
    <published>2019-08-31T05:14:57Z</published>
    <summary type="html">Hello Mohammed , &lt;br /&gt;Thanks for your continuous suggestion .&lt;br /&gt;This approach worked for me . &lt;br /&gt;&lt;br /&gt;Thanks and Regards, &lt;br /&gt;​​​​​​​Pradip</summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2019-08-31T05:14:57Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114881913" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114881913</id>
    <updated>2019-08-26T11:21:16Z</updated>
    <published>2019-08-26T11:21:16Z</published>
    <summary type="html">Hello Mohammed , &lt;br /&gt;This is actually good approach , &lt;br /&gt;I will try this case .&lt;br /&gt;&lt;br /&gt;Thanks &amp;amp; Regards , &lt;br /&gt;Pradip</summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2019-08-26T11:21:16Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114879066" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114879066</id>
    <updated>2019-08-26T10:18:40Z</updated>
    <published>2019-08-26T10:18:40Z</published>
    <summary type="html">Ok in this case as your running a background process it does not  have anything as signed in or signed out ? You can directly user UserLocalServiceUtil.getDefaultUser(PortalUtil.getDefaultCompanyId()) but still you want to capture when user triggered this was he signed in or not then you can actually save themeDisplay.isSignedIn() value in taskcontextmap and retrieve it here </summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2019-08-26T10:18:40Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114881553" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114881553</id>
    <updated>2019-08-26T10:11:31Z</updated>
    <published>2019-08-26T10:11:31Z</published>
    <summary type="html">Hello Mohammed,&lt;br /&gt;&lt;br /&gt;I am using themeDisplay in below schenerious ,&lt;br /&gt;superAdminIds=UserLocalServiceUtil.getRoleUserIds(RoleLocalServiceUtil.getRole(themeDisplay.getCompanyId(), RoleConstants.ADMINISTRATOR).getRoleId());&lt;br /&gt;&lt;br /&gt;if(themeDisplay.isSignedIn()){&lt;br /&gt;                 parentOrgAdminEmailId=themeDisplay.getUser().getEmailAddress();&lt;br /&gt;             }else{&lt;br /&gt;                 parentOrgAdminEmailId=themeDisplay.getDefaultUser().getEmailAddress();&lt;br /&gt;             }&lt;br /&gt;&lt;br /&gt;If we get requeset , response object also in execute method , that is also useful for us becoz using request we can get themeDisplay object in execute method , but we are not getting request , response object also .&lt;br /&gt;&lt;br /&gt;Thanks &amp;amp; Regards, &lt;br /&gt;Pradip</summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2019-08-26T10:11:31Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114878687" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114878687</id>
    <updated>2019-08-26T09:20:40Z</updated>
    <published>2019-08-26T09:20:40Z</published>
    <summary type="html">Hi,    As i told service context which you are creating using servicecontext contructor will give a plain servicecontext wihtout themedisplay ,request object ,etc . And in Background executor you will not have themedisplay object as you don&amp;#39;t have Request Object for that .  Can you please share the use of themedisplay in your code as we can find alternate for that .</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2019-08-26T09:20:40Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114880809" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114880809</id>
    <updated>2019-08-26T09:03:53Z</updated>
    <published>2019-08-26T09:03:53Z</published>
    <summary type="html">Hello Mohammed , &lt;br /&gt;Thanks for guidence purpose .&lt;br /&gt;I tried ThemDisplay obj getting from ServletContext but it giving null .&lt;br /&gt;I am attaching snap below .&lt;br /&gt;(Note :In doView method instead of backgroundTaskmanager.addBackGroundTask(---) , I am using BackgroundTaskManagerUtil.addBackgroundTask(---)  in below snap)&lt;br /&gt;​​​​​​​&lt;br /&gt;Thanks And Regards, &lt;br /&gt;Pradip</summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2019-08-26T09:03:53Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114879732" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114879732</id>
    <updated>2019-08-25T19:07:40Z</updated>
    <published>2019-08-25T19:07:40Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Ideally you will be requiring service context object for creating Organization&amp;nbsp; in background task executor as you dont have request object you need to create service context object and update the object with required attribute for your useYou can use like this and use the service context object .ServiceContext &amp;nbsp;serviceContext = new ServiceContext();&lt;br&gt;serviceContext.setCompanyId(companyId);&lt;br&gt;serviceContext.setScopeGroupId(scopeGroupId);&lt;pre&gt;&lt;code&gt;&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;&lt;/code&gt;&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2019-08-25T19:07:40Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114856989" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114856989</id>
    <updated>2019-08-24T09:02:37Z</updated>
    <published>2019-08-24T09:02:37Z</published>
    <summary type="html">&lt;blockquote&gt;&lt;em&gt;Thanks Mohammed, &lt;br /&gt;for continuing giving feedback..&lt;br /&gt;​​​​​​​&lt;br /&gt;I want those object while creation of the organisation that code execute backgroundly  and it placed in execute() method.&lt;br /&gt;means like when execute() method called by container , In that I will get all data from Map object like orgName,OrgEmail ,themeDisplay and other Object and I will use those object to creation of the Organisation&lt;/em&gt;&lt;br /&gt;&lt;/blockquote&gt;</summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2019-08-24T09:02:37Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114873392" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114873392</id>
    <updated>2019-08-24T08:57:52Z</updated>
    <published>2019-08-24T08:57:52Z</published>
    <summary type="html">Ok can you please tell me the exact use of Themedisplay and other objects in background executor ?</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2019-08-24T08:57:52Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114856652" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114856652</id>
    <updated>2019-08-24T07:00:39Z</updated>
    <published>2019-08-24T07:00:39Z</published>
    <summary type="html">Hello Mohammed,&lt;br /&gt;Thanks again .. continuously you are giving your time &lt;br /&gt;so, as per suggestion I am creating 1 json in that I am putting all values and while setting in taskContextMap I am converting it into serializable and I am sending . &lt;br /&gt;But actually , we need ThemeDisplay obj , PortletPreference , ResourceRequest , ResourceResponse this object also in execute method . But they comes as null or getting ClassCastException for some object &lt;br /&gt;so , again we getting wrapper class object values only &lt;br /&gt;&lt;br /&gt;Thanks and Regards, &lt;br /&gt;​​​​​​​ Pradip Choudhari </summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2019-08-24T07:00:39Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114853420" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114853420</id>
    <updated>2019-08-23T16:48:16Z</updated>
    <published>2019-08-23T16:48:16Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;blockquote&gt;&lt;br&gt;It looks taskContextMap taking only wrapper class object &amp;nbsp;values only , If we creating our own pojo class with serializable and passing in the map object . It will throwing same object.&lt;/blockquote&gt;&lt;br&gt;Hi Pradip ,&amp;nbsp;&lt;br&gt;&amp;nbsp; As per my understanding your setting your Serialized Pojo class in taskContextMap ? I would suggest you&amp;nbsp; if its entity of service builder you could add the primary key&amp;nbsp; of that entity object in taskContextMap&amp;nbsp; and use that reference in your TaskExecutor . In case you want to have&amp;nbsp; just pojo in&amp;nbsp;&amp;nbsp;taskContextMap&amp;nbsp; then you can also make use of json utiltity of liferay and build&amp;nbsp; json and save the json string something like below.&lt;br&gt;&lt;pre&gt;&lt;code&gt;JSONObject jsonObject JSONFactoryUtil.createJSONObject();
jsonObject.put("abc", "xyz");
jsonObject.toJSONString();[code]&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;​​​​​​​&lt;br&gt;But if in case you wanted to use Serialized Pojo only then also i think it should work if your Pojo is&amp;nbsp; serializable may be you can refer below to make you class serializable &lt;a href="https://www.vogella.com/tutorials/JavaSerialization/article.html"&gt;https://www.vogella.com/tutorials/JavaSerialization/article.html&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2019-08-23T16:48:16Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114848652" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114848652</id>
    <updated>2019-08-23T14:01:19Z</updated>
    <published>2019-08-23T14:01:19Z</published>
    <summary type="html">Hello Mohammed ,&lt;br /&gt;Thanks for giving your valuable time for sharing knowledge &lt;br /&gt;I updated my code But i am unable to calling execute method .&lt;br /&gt;and I am attaching sample code .&lt;br /&gt;Getting exception as like below -&lt;br /&gt;&lt;br /&gt;​​​​​​​13:49:02,544 INFO  [http-nio-7095-exec-9][BackgroundTaskPortlet:65] BackgroundTaskPortlet.doView()============&lt;br /&gt;13:49:30,491 ERROR [http-nio-7095-exec-9][status_jsp:950] com.liferay.portal.kernel.portlet.PortletContainerException: com.liferay.portal.kernel.portlet.PortletContainerException: javax.servlet.ServletException: java.lang.StackOverflowError&lt;br /&gt;&lt;br /&gt;It looks taskContextMap taking only wrapper class object  values only , If we creating our own pojo class with serializable and passing in the map object . It will throwing same object.</summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2019-08-23T14:01:19Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114839071" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114839071</id>
    <updated>2019-08-22T12:23:09Z</updated>
    <published>2019-08-22T12:23:09Z</published>
    <summary type="html">Can you please  share complete error and java code</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2019-08-22T12:23:09Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114841433" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114841433</id>
    <updated>2019-08-22T12:13:15Z</updated>
    <published>2019-08-22T12:13:15Z</published>
    <summary type="html">Hello Mohammed,&lt;br /&gt;I am trying that approach using docs reference code &lt;br /&gt;But while deployment I am getting &lt;br /&gt;java.lang.IllegalArgumentException: Property &amp;#34;&lt;strong&gt;background.task.executor.class.name&lt;/strong&gt;&amp;#34; is not set for &lt;a href="com.vy.testExecutor.MyTestExecutor@5ffd2a64"&gt;com.vy.testExecutor.MyTestExecutor@5ffd2a64&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;em&gt;you have any idea on this issue , for reference purpose I am sending snap of the my test class&lt;br /&gt;&lt;/em&gt;Thanks and regards,&lt;br /&gt;​​​​​​​ Pradip</summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2019-08-22T12:13:15Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114834942" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114834942</id>
    <updated>2019-08-21T16:19:37Z</updated>
    <published>2019-08-21T16:19:37Z</published>
    <summary type="html">If your using lIferay 7 onwards you can refer &lt;a href="https://www.learnandpost.com/2018/05/background-task-liferay-7-or-dxp-part-1.html"&gt;https://www.learnandpost.com/2018/05/background-task-liferay-7-or-dxp-part-1.html&lt;/a&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2019-08-21T16:19:37Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114834608" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114834608</id>
    <updated>2019-08-21T16:18:24Z</updated>
    <published>2019-08-21T16:18:24Z</published>
    <summary type="html">which version of liferay your using ?</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2019-08-21T16:18:24Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114835759" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114835759</id>
    <updated>2019-08-21T14:38:25Z</updated>
    <published>2019-08-21T14:38:25Z</published>
    <summary type="html">&lt;blockquote&gt;&lt;em&gt;Hello Mohammed,&lt;br /&gt;  I am trying this approach but BackgroundTaskLocalServiceUtil  this class not finding Liferay  &lt;br /&gt;so , I  am getting ClassNotFoundException for this class&lt;br /&gt;for reference purpose I am using below document &lt;br /&gt;&lt;a href="http://liferaytutorial.blogspot.com/2015/08/executing-background-task.html"&gt;http://liferaytutorial.blogspot.com/2015/08/executing-background-task.html&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;Thanks and Regards ,&lt;br /&gt;​​​​​​​  Pradip &lt;/em&gt;&lt;br /&gt;&lt;/blockquote&gt;</summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2019-08-21T14:38:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114835423" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114835423</id>
    <updated>2019-08-21T14:01:09Z</updated>
    <published>2019-08-21T14:01:09Z</published>
    <summary type="html">Hello Mohammed &lt;br /&gt;   Thanks for quick reply , I will check document </summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2019-08-21T14:01:09Z</dc:date>
  </entry>
  <entry>
    <title>RE: Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114829827" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114829827</id>
    <updated>2019-08-21T12:22:35Z</updated>
    <published>2019-08-21T12:22:35Z</published>
    <summary type="html">Hi,  You can try background process  for reading excel and updating  organization site template&lt;br /&gt;May be u can refer below url &lt;a href="https://liferay.dev/blogs/-/blogs/background-task-a-k-a-the-secret-weapon-behind-the-new-asynchronous-staging"&gt;https://liferay.dev/blogs/-/blogs/background-task-a-k-a-the-secret-weapon-behind-the-new-asynchronous-staging&lt;/a&gt;</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2019-08-21T12:22:35Z</dc:date>
  </entry>
  <entry>
    <title>Multiple Organization creation Process takes time</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114831276" />
    <author>
      <name>pradip choudhari</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114831276</id>
    <updated>2019-08-21T11:18:00Z</updated>
    <published>2019-08-21T11:18:00Z</published>
    <summary type="html">we have one portlet , In that we are getting Organisation name and email Id from the Excel sheet and we creating Organization .For creating 1 Organisation it will take 2-3 minutes , thats not good for the end user experience . so we decided to use Multithreading but there also we getting Deadlock situation while creating multiple organisation .&lt;br /&gt;while creating Organisation when we applying site template for Organisation that process it taking more time &lt;br /&gt;below is the method for applying site Template .&lt;br /&gt;SitesUtil.&lt;strong&gt;updateLayoutSetPrototypesLinks&lt;/strong&gt;(organization.getGroup(), publicLayoutSetPrototypeId,privateLayoutSetPrototypeId, publicLayoutSetPrototypeLinkEnabled,&lt;br /&gt;                    privateLayoutSetPrototypeLinkEnabled);&lt;br /&gt;we have any other approach to apply site template or any other solution that make Organisation creation process fast ?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  </summary>
    <dc:creator>pradip choudhari</dc:creator>
    <dc:date>2019-08-21T11:18:00Z</dc:date>
  </entry>
</feed>
