<?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>OSGI dude, overriding JournalArticleSitemapURLProvider</title>
  <link rel="self" href="https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=115114154" />
  <subtitle>OSGI dude, overriding JournalArticleSitemapURLProvider</subtitle>
  <id>https://uat.liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=115114154</id>
  <updated>2026-08-02T05:40:04Z</updated>
  <dc:date>2026-08-02T05:40:04Z</dc:date>
  <entry>
    <title>RE: OSGI dude, overriding JournalArticleSitemapURLProvider</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117198253" />
    <author>
      <name>Javier Lamadrid</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117198253</id>
    <updated>2019-09-18T09:56:24Z</updated>
    <published>2019-09-18T09:56:24Z</published>
    <summary type="html">I check it, thank you very much Minhchau!&lt;br /&gt;&lt;br /&gt;Regards</summary>
    <dc:creator>Javier Lamadrid</dc:creator>
    <dc:date>2019-09-18T09:56:24Z</dc:date>
  </entry>
  <entry>
    <title>RE: OSGI dude, overriding JournalArticleSitemapURLProvider</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115350731" />
    <author>
      <name>Minhchau Dang</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115350731</id>
    <updated>2019-09-14T00:47:39Z</updated>
    <published>2019-09-14T00:47:39Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;Javier Lamadrid:&lt;/div&gt;&lt;blockquote&gt;What about &amp;#34;com.liferay.portal.util.LayoutSitemapURLProvider&amp;#34;?&lt;/blockquote&gt;&lt;br /&gt;It&amp;#39;s injected via &lt;a href="https://github.com/liferay/liferay-portal/blob/7.2.0-ga1/portal-impl/src/META-INF/layout-spring.xml#L41"&gt;layout-spring.xml&lt;/a&gt;, so it ends up being part of the system bundle 0, which is probably not compatible with the way Liferay implemented component blacklists (from reading the code, it seems like it watches for non-system bundle start events, though I could be wrong).&lt;br /&gt;&lt;br /&gt;As a workaround, you could add a custom layout-spring.xml to Liferay&amp;#39;s WEB-INF/classes/META-INF that comments out the reference to the class so that no Spring bean gets created (and thus no OSGi component gets injected once the portal is initialized). In the future (7.3 and beyond), it should be possible to blacklist it because it&amp;#39;s moved outside of system bundle 0 with &lt;a href="https://issues.liferay.com/browse/LPS-97978"&gt;LPS-97978&lt;/a&gt;.</summary>
    <dc:creator>Minhchau Dang</dc:creator>
    <dc:date>2019-09-14T00:47:39Z</dc:date>
  </entry>
  <entry>
    <title>RE: OSGI dude, overriding JournalArticleSitemapURLProvider</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115134364" />
    <author>
      <name>Javier Lamadrid</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115134364</id>
    <updated>2019-09-08T08:53:36Z</updated>
    <published>2019-09-08T08:53:36Z</published>
    <summary type="html">It works correctly, thank you very much David!&lt;br /&gt;&lt;br /&gt;I would like to ask you another question: What about &amp;#34;com.liferay.portal.util.LayoutSitemapURLProvider&amp;#34;? In this case there is no @Component annotation, instead there is an @OSGiBeanProperties and it cannot be added to the blacklist (or I don&amp;#39;t know how to). On the other hand, the unorthodox solution of the negative ranking seems to continue working, is there a more correct solution?. Thank you very much in advance.&lt;br /&gt;Regards.</summary>
    <dc:creator>Javier Lamadrid</dc:creator>
    <dc:date>2019-09-08T08:53:36Z</dc:date>
  </entry>
  <entry>
    <title>RE: OSGI dude, overriding JournalArticleSitemapURLProvider</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115132132" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115132132</id>
    <updated>2019-09-06T22:17:29Z</updated>
    <published>2019-09-06T22:17:29Z</published>
    <summary type="html">Keep your component as is. Just add the Liferay component to the blacklist to prevent it from starting and taking your component&amp;#39;s place.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2019-09-06T22:17:29Z</dc:date>
  </entry>
  <entry>
    <title>OSGI dude, overriding JournalArticleSitemapURLProvider</title>
    <link rel="alternate" href="https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115114153" />
    <author>
      <name>Javier Lamadrid</name>
    </author>
    <id>https://uat.liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=115114153</id>
    <updated>2019-09-06T14:18:31Z</updated>
    <published>2019-09-06T14:18:31Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi!,&lt;br&gt;&lt;br&gt;What is the correct way to override the JournalArticleSitemapURLProvider service to create a custom sitemap in direct web content?.&lt;br&gt;&lt;br&gt;If I simply create a SitemapURLProvider service for the JournalArticle classname(*) it works when deployed the first time, but when the server is restarted, the service is registered first and the one that is treated is Liferay (JournalArticleSitemapUrlProvider). Even if a "service.ranking: Integer = 100" is added.&lt;br&gt;Curiously, if I do the same with a negative ranking, it seems to work correctly, but so a priori it seems to me that I am not doing the right thing &lt;img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif"&gt;&lt;br&gt;&lt;br&gt;(*)&lt;br&gt;&lt;pre&gt;&lt;code&gt;
@Component (immediate = true, service = SitemapURLProvider.class)
public class CustomJournalArticleSitemapUrlProvider implements SitemapURLProvider {
@Override
public String getClassName () {
return JournalArticle.class.getName ();
}
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Regards,&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Javier Lamadrid</dc:creator>
    <dc:date>2019-09-06T14:18:31Z</dc:date>
  </entry>
</feed>
