留言板

No Group exists with the key {companyId=46029, classNameId=10003, classPK=4

Piyush Shukla,修改在8 年前。

No Group exists with the key {companyId=46029, classNameId=10003, classPK=4

Junior Member 帖子: 46 加入日期: 15-9-18 最近的帖子
Hi,
I am adding organization using below snnipet (liferay 6.2)
long organizationId = CounterLocalServiceUtil.increment();
Organization organization = OrganizationLocalServiceUtil.createOrganization(organizationId);
organization.setName("xyz");
......................
OrganizationLocalServiceUtil.addOrganization(organization); // add organization
organization is added properly in the DB, but when i access organization from control panel it thorugh some error on console like
com.liferay.portal.NoSuchGroupException: No Group exists with the key {companyId=10154, classNameId=10003, classPK=27877}
How to resolve this problem.


Regards
Piyush shukla
thumbnail
Jan Geißler,修改在8 年前。

RE: No Group exists with the key {companyId=46029, classNameId=10003, class

Liferay Master 帖子: 735 加入日期: 11-7-5 最近的帖子
Yeah. Common Problem.
The Method you are trying to use does obviously not call other backend methods for Group-Creation etc.

You should use:

OrganizationLocalServiceUtil.addOrganization(userId, parentOrganizationId, name, type, regionId, countryId, statusId, comments, site, serviceContext)