AddAddress liferay 7.4 not working

Jamie Sammons, modified 3 Years ago. New Member Posts: 7 Join Date: 10/8/19 Recent Posts

Hello,

i'm trying to add an address for a user with liferay 7.4 with the method :

addressLocalService.addAddress(referenceCode, adminUser.getUserId(), Contact.class.getName(), user.getContactId(),"","",  streetUser,  "", "", cityUser, zipUser, 21208, 21185, 11000, false,   true, phoneUser,  serviceContext);

The problem is that i receive a message No User exists with the primary key 0 

i did this before to have an admin user that can addAddress:

adminUser = UserLocalServiceUtil.getUserByScreenName(companyId, "job-admin"); PermissionChecker checker = PermissionCheckerFactoryUtil.create(adminUser); PermissionThreadLocal.setPermissionChecker(checker);

What could be the problem?