<?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>Bug: 404-error in RESTful service for custom object</title>
  <link rel="self" href="https://liferay.dev/de/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=123173855" />
  <subtitle>Bug: 404-error in RESTful service for custom object</subtitle>
  <id>https://liferay.dev/de/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=123173855</id>
  <updated>2026-04-17T20:18:39Z</updated>
  <dc:date>2026-04-17T20:18:39Z</dc:date>
  <entry>
    <title>RE: RE: Bug: 404-error in RESTful service for custom object</title>
    <link rel="alternate" href="https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123182763" />
    <author>
      <name>Marco Nguitragool</name>
    </author>
    <id>https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123182763</id>
    <updated>2025-01-22T16:19:36Z</updated>
    <published>2025-01-14T02:55:54Z</published>
    <summary type="html">&lt;p&gt;I should also mention that I use Liferay in docker. Maybe this makes
  a difference.&lt;/p&gt;
&lt;p&gt;=&amp;gt; https://hub.docker.com/r/liferay/portal&lt;/p&gt;
&lt;p&gt;=&amp;gt; image: liferay/portal:7.4.3.129-ga129&lt;/p&gt;</summary>
    <dc:creator>Marco Nguitragool</dc:creator>
    <dc:date>2025-01-14T02:55:54Z</dc:date>
  </entry>
  <entry>
    <title>RE: RE: Bug: 404-error in RESTful service for custom object</title>
    <link rel="alternate" href="https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123182729" />
    <author>
      <name>Marco Nguitragool</name>
    </author>
    <id>https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123182729</id>
    <updated>2025-01-22T16:19:06Z</updated>
    <published>2025-01-14T02:35:45Z</published>
    <summary type="html">&lt;p&gt;Thanks a lot for your reply!&lt;/p&gt;
&lt;p&gt;Since the &amp;quot;owner&amp;quot; is optional, it &lt;em&gt;should&lt;/em&gt; also work
  fine with an empty JSON-object according to my understanding of an
  ordinary RESTful resource (not specifically Liferay, but REST in general).&lt;/p&gt;
&lt;p&gt;But as I already pointed out in my original post, I tried many
  different variations, including the one you mentioned (with the
  &amp;quot;owner&amp;quot; only) and even a full-blown object with all
  properties. None of them worked. Also, the GET / should IMHO always
  work (even before creating the first object, leading to an empty
  &amp;quot;page&amp;quot;-JSON) -- but all of them give me a 404.&lt;/p&gt;</summary>
    <dc:creator>Marco Nguitragool</dc:creator>
    <dc:date>2025-01-14T02:35:45Z</dc:date>
  </entry>
  <entry>
    <title>RE: Bug: 404-error in RESTful service for custom object</title>
    <link rel="alternate" href="https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123182047" />
    <author>
      <name>Russell Bohl</name>
    </author>
    <id>https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123182047</id>
    <updated>2025-01-13T19:25:34Z</updated>
    <published>2025-01-13T19:25:34Z</published>
    <summary type="html">&lt;p&gt;Hi Marco, you said:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;Click on &amp;quot;POST / postBlabla&amp;quot;. The JSON to be sent doesn't
    really matter, because all data should be optional, but neither a
    full-blown JSON nor a minimal &amp;quot;{}&amp;quot; or &amp;quot;{
    &amp;quot;owner&amp;quot;: &amp;quot;abc&amp;quot; }&amp;quot; works -- all leads to a 404-error.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This does not seem to be true. Try posting with just this request body:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;{
  &amp;quot;owner&amp;quot;: &amp;quot;blabla&amp;quot;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I had no issue at all with the GET request, it returned a 200 for me.&lt;/p&gt;
&lt;p&gt;The only caveat is that I did not test on the exact versions you
  mentioned. I'm on a more recent build, DXP U131.&lt;/p&gt;</summary>
    <dc:creator>Russell Bohl</dc:creator>
    <dc:date>2025-01-13T19:25:34Z</dc:date>
  </entry>
  <entry>
    <title>Bug: 404-error in RESTful service for custom object</title>
    <link rel="alternate" href="https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123173854" />
    <author>
      <name>Marco Nguitragool</name>
    </author>
    <id>https://liferay.dev/de/c/message_boards/find_message?p_l_id=119785294&amp;messageId=123173854</id>
    <updated>2025-01-13T16:36:07Z</updated>
    <published>2025-01-10T03:38:55Z</published>
    <summary type="html">&lt;p&gt;
  &lt;u&gt;
    &lt;strong&gt;Short description&lt;/strong&gt;
  &lt;/u&gt;
&lt;/p&gt;
&lt;p&gt;GET or POST on the RESTful service automatically deployed for a
  custom object causes a 404-error.&lt;/p&gt;
&lt;p&gt;
  &lt;u&gt;
    &lt;strong&gt;How to reproduce&lt;/strong&gt;
  &lt;/u&gt;
&lt;/p&gt;
&lt;p&gt;Go into Control Panel =&amp;gt; Object / Objects.&lt;/p&gt;
&lt;p&gt;Click the &amp;quot;+&amp;quot;-button to create a new object.&lt;/p&gt;
&lt;p&gt;Enter some data -- which does not matter, but here's my example:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Label: Blabla&lt;/li&gt;
  &lt;li&gt;Plural label: Blablas&lt;/li&gt;
  &lt;li&gt;Object name: Blabla&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Click &amp;quot;Save&amp;quot;.&lt;/p&gt;
&lt;p&gt;The new object is now listed in the table. Click on
  &amp;quot;Blabla&amp;quot; in this table to edit it further.&lt;/p&gt;
&lt;p&gt;Click on the tab &amp;quot;Fields&amp;quot;.&lt;/p&gt;
&lt;p&gt;Click on the &amp;quot;+&amp;quot; to add a new field. Here's what I entered:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Label: Owner&lt;/li&gt;
  &lt;li&gt;Field name: owner&lt;/li&gt;
  &lt;li&gt;Type: Text&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Click &amp;quot;Save&amp;quot;.&lt;/p&gt;
&lt;p&gt;Now switch to the tab &amp;quot;Details&amp;quot; and click
  &amp;quot;Publish&amp;quot; to publish the object. Liferay confirms in a small
  green box that it published it.&lt;/p&gt;
&lt;p&gt;Open a new tab in the browser and go to the &amp;quot;Liferay API
  Explorer&amp;quot; -- mine is on: https://dragonkingchocolate.com/liferay/o/api&lt;/p&gt;
&lt;p&gt;Click on &amp;quot;REST Applications&amp;quot; and the newly added object is
  available as RESTful API there: c/blablas&lt;/p&gt;
&lt;p&gt;Select &amp;quot;c/blablas&amp;quot; from the drop-down.&lt;/p&gt;
&lt;p&gt;Click on &amp;quot;GET / getBlablasPage&amp;quot; for querying the list of
  the objects. It opens the details for this RESTful operation.&lt;/p&gt;
&lt;p&gt;Click on &amp;quot;Execute&amp;quot;. I'd expect an empty list (with some
  meta-data being present), i.e. one single instance of the BlablasPage
  without any items. But I get a 404-error.&lt;/p&gt;
&lt;p&gt;Click on &amp;quot;POST / postBlabla&amp;quot;. The JSON to be sent doesn't
  really matter, because all data should be optional, but neither a
  full-blown JSON nor a minimal &amp;quot;{}&amp;quot; or &amp;quot;{
  &amp;quot;owner&amp;quot;: &amp;quot;abc&amp;quot; }&amp;quot; works -- all leads to a 404-error.&lt;/p&gt;
&lt;p&gt;
  &lt;u&gt;
    &lt;strong&gt;Liferay version&lt;/strong&gt;
  &lt;/u&gt;
&lt;/p&gt;
&lt;p&gt;​​​​​​​Liferay Community Edition Portal 7.4.3.129 CE GA129 (December
  09, 2024)&lt;/p&gt;
&lt;p&gt;Liferay Community Edition Portal 7.4.3.120 CE GA120 (June 12, 2024)&lt;/p&gt;
&lt;p&gt;...the error is the same in both versions.&lt;/p&gt;
&lt;p&gt;
  &lt;u&gt;
    &lt;strong&gt;Page-building works&lt;/strong&gt;
  &lt;/u&gt;
&lt;/p&gt;
&lt;p&gt;Note that the building of a page to list/create/edit/delete instances
  of my custom object works fine. My object seems to be fully functional
  in the page I created for it -- but the RESTful API only gets 404-errors.&lt;/p&gt;</summary>
    <dc:creator>Marco Nguitragool</dc:creator>
    <dc:date>2025-01-10T03:38:55Z</dc:date>
  </entry>
</feed>
