<?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>AddAddress liferay 7.4 not working</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121527775" />
  <subtitle>AddAddress liferay 7.4 not working</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121527775</id>
  <updated>2026-04-03T17:32:40Z</updated>
  <dc:date>2026-04-03T17:32:40Z</dc:date>
  <entry>
    <title>AddAddress liferay 7.4 not working</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121527774" />
    <author>
      <name>Pietro Pagani</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121527774</id>
    <updated>2022-10-03T14:06:15Z</updated>
    <published>2022-10-03T08:44:45Z</published>
    <summary type="html">&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;i'm trying to add an address for a user with liferay 7.4 with the
  method :&lt;/p&gt;
&lt;pre&gt;
addressLocalService.addAddress(referenceCode, adminUser.getUserId(), Contact.class.getName(), user.getContactId(),&amp;quot;&amp;quot;,&amp;quot;&amp;quot;,  streetUser,  &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, cityUser, zipUser, 21208, 21185, 11000, false,   true, phoneUser,  serviceContext);

&lt;/pre&gt;
&lt;p&gt;The problem is that i receive a message &lt;strong&gt;No User exists with
    the primary key 0 &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;i did this before to have an admin user that can addAddress:&lt;/p&gt;
&lt;p&gt;adminUser = UserLocalServiceUtil.getUserByScreenName(companyId,
  &amp;quot;job-admin&amp;quot;); PermissionChecker checker =
  PermissionCheckerFactoryUtil.create(adminUser); PermissionThreadLocal.setPermissionChecker(checker);&lt;/p&gt;
&lt;p&gt;What could be the problem?&lt;/p&gt;</summary>
    <dc:creator>Pietro Pagani</dc:creator>
    <dc:date>2022-10-03T08:44:45Z</dc:date>
  </entry>
</feed>
