Creating JournalFolder from UpdateArticleMVCActionCommand.Creating JournalFolder from UpdateArticleMVCActionCommand.https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1197338762024-03-28T14:34:58Z2024-03-28T14:34:58ZRE: Creating JournalFolder from UpdateArticleMVCActionCommand.Christoph Rabelhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1197425052020-08-11T07:47:30Z2020-08-11T07:47:30ZPlease check serviceContext.getExpandoBridgeAttributes().<br />It returns a map. Please check the content. If this map is null or empty, nothing should happen. It simply can't throw because the relevant line is never reached. So, the map has to contain something. If you create a fresh serviceContext, the map should be empty.Christoph Rabel2020-08-11T07:47:30ZRE: Creating JournalFolder from UpdateArticleMVCActionCommand.Yogesh Chandrahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1197403682020-08-11T07:13:02Z2020-08-11T07:13:02ZYes, it's happening. I have tried all possible ways to create ServiceContext object.Yogesh Chandra2020-08-11T07:13:02ZRE: Creating JournalFolder from UpdateArticleMVCActionCommand.Christoph Rabelhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1197421522020-08-11T06:27:25Z2020-08-11T06:27:25ZWhen you do:<br /> ServiceContext serviceContext = new ServiceContext();<br /> JournalFolder folder = JournalFolderLocalServiceUtil.addFolder(themeDisplay.getUserId(), groupId,<br /> parentFolderId, folderName, folderDescription,<br /> serviceContext);<br />The same exception still happens? That surprises me.Christoph Rabel2020-08-11T06:27:25ZRE: Creating JournalFolder from UpdateArticleMVCActionCommand.Yogesh Chandrahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1197389692020-08-10T17:18:24Z2020-08-10T17:18:24ZHi <strong>Christoph Rabel,</strong><strong>I have tried passing the JournalArticle's ServiceContext as well as the new ServiceContext object but it did not help. This code was running in 6.2 but throwing error after migrating to 7.2</strong>Yogesh Chandra2020-08-10T17:18:24ZRE: Creating JournalFolder from UpdateArticleMVCActionCommand.Christoph Rabelhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1197349462020-08-10T14:34:12Z2020-08-10T14:34:12ZCould you check the expando attributes in the serviceContext?<br />serviceContext.getExpandoBridgeAttributes() returns a map.<br />I believe it tries to set an attribute that does exist for JournalArticle but that doesn't exist for folder.<br />Instead of using ServiceContextFactory.getInstance, I would simply create a new ServiceContext object and use that one. If you need to transport information, I would copy it from the JournalArticle serviceContext (e.g. if you want the folder to have the same permissions as the article).Christoph Rabel2020-08-10T14:34:12ZCreating JournalFolder from UpdateArticleMVCActionCommand.Yogesh Chandrahttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1197338752020-08-10T12:27:29Z2020-08-10T12:27:29ZHi Team,I have a requirement to create JournalFolder while creating content of a particular structure. For that, I have Customized UpdateArticleMVCActionCommand and creating JournalFolder using the below code.<br /> ServiceContext serviceContext = ServiceContextFactory.getInstance(JournalFolder.class.getName(), actionRequest);<br /> JournalFolder folder = JournalFolderLocalServiceUtil.addFolder(themeDisplay.getUserId(), groupId,<br /> parentFolderId, folderName, folderDescription,<br /> serviceContext);<br />Below are logs that I am getting while creating a content.Caused by: java.lang.RuntimeException: java.lang.NullPointerException<br /> at com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl.setAttributes(ExpandoBridgeImpl.java:540)<br /> at com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl.setAttributes(ExpandoBridgeImpl.java:562)<br /> at com.liferay.portlet.expando.model.impl.