<?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>java.lang.ClassNotFoundException: com.liferay.util.ContentUtil</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=104952436" />
  <subtitle>java.lang.ClassNotFoundException: com.liferay.util.ContentUtil</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=104952436</id>
  <updated>2026-04-03T23:06:25Z</updated>
  <dc:date>2026-04-03T23:06:25Z</dc:date>
  <entry>
    <title>RE: java.lang.ClassNotFoundException: com.liferay.util.ContentUtil</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119667972" />
    <author>
      <name>Rafał Pydyniak</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119667972</id>
    <updated>2020-07-29T09:00:39Z</updated>
    <published>2020-07-29T09:00:39Z</published>
    <summary type="html">Hello,&lt;br /&gt;in case someone had such problem in Liferay 7.2 (maybe also in 7.1 - didn&amp;#39;t check that) - it seems that that has been changed and now to access ContentUtil class you have to add following dependency in build.gradle: compileOnly group: &amp;#34;com.liferay&amp;#34;, name: &amp;#34;com.liferay.petra.content&amp;#34;</summary>
    <dc:creator>Rafał Pydyniak</dc:creator>
    <dc:date>2020-07-29T09:00:39Z</dc:date>
  </entry>
  <entry>
    <title>RE: java.lang.ClassNotFoundException: com.liferay.util.ContentUtil</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=105041614" />
    <author>
      <name>Sudhanshu Kumar Shukla</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=105041614</id>
    <updated>2018-03-09T06:45:09Z</updated>
    <published>2018-03-09T06:45:09Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div class="quote-title"&gt;Eddie Chow:&lt;/div&gt;&lt;blockquote&gt;Can you try removing the Imports from the bnd.bnd file. Those should be taken care of by Gradle since we have them declared as dependencies. Let me know if this works.&lt;/blockquote&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks Now It's Working&lt;br&gt;&lt;br&gt;And I have done One More Change In build.gradle file which I think I need to share &lt;br&gt;&lt;strong&gt;Chaged Code &lt;/strong&gt;&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;compile group: "com.liferay.portal", name: "com.liferay.portal.impl", version: "2.0.0"&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;I have Changed &lt;strong&gt;CompileOnly &lt;/strong&gt;to &lt;strong&gt;Compile&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;Because from &lt;strong&gt;CompileOnly &lt;/strong&gt;  it will make the jar available for source code but at runtime, it is not including the classes.&lt;br&gt;&lt;br&gt;Finally My Working &lt;strong&gt;bnd.bnd&lt;/strong&gt; File is &lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;Bundle-Name: BI_Enquiry-web
Bundle-SymbolicName: com.bumerguard.international
Bundle-Version: 1.0.0
Export-Package: com.bumerguard.international.constants;
Import-Package: \
				!com.swabunga.spell.engine,\
				!com.swabunga.spell.*,\
				!net.fortuna.ical4j.model,\
				!net.fortuna.ical4j.*,\
				!org.apache.axis.tools.ant.wsdl,\
				!org.apache.*,\
				*
Bundle-ClassPath:\
				 .,\
				 lib/com.liferay.util.java-2.0.0.jar
-includeresource:\
				 lib/com.liferay.util.java-2.0.0.jar=com.liferay.util.java-2.0.0.jar&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;And &lt;strong&gt;build.gradle&lt;/strong&gt; file is &lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;dependencies {
	compile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"
	compile group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "2.0.0"
	compile group: "com.liferay.portal", name: "com.liferay.util.java", version: "2.0.0"
	compile group: "com.liferay.portal", name: "com.liferay.portal.impl", version: "2.0.0"
	compile group: "javax.portlet", name: "portlet-api", version: "2.0"
	compile group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
	compile group: "jstl", name: "jstl", version: "1.2"
	compile group: "org.osgi", name: "osgi.cmpn", version: "6.0.0"
	compile group: 'javax.mail', name: 'mail', version: '1.4.7'
	compileOnly project(":modules:BI_Enquiry-services:BI_Enquiry-services-api")
	compileOnly project(":modules:BI_Enquiry-services:BI_Enquiry-services-service")
}
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;May This will help For Someone.&lt;br&gt;&lt;br&gt;If I have done wrong anywhere please let me know.&lt;br&gt;&lt;br&gt;Thanks&lt;img alt="emoticon" src="@theme_images_path@/emoticons/smile.gif"&gt;&lt;img alt="emoticon" src="@theme_images_path@/emoticons/smile.gif"&gt;&lt;img alt="emoticon" src="@theme_images_path@/emoticons/smile.gif"&gt;&lt;img alt="emoticon" src="@theme_images_path@/emoticons/smile.gif"&gt;&lt;img alt="emoticon" src="@theme_images_path@/emoticons/smile.gif"&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Sudhanshu Kumar Shukla</dc:creator>
    <dc:date>2018-03-09T06:45:09Z</dc:date>
  </entry>
  <entry>
    <title>RE: java.lang.ClassNotFoundException: com.liferay.util.ContentUtil</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=105034926" />
    <author>
      <name>Eddie Chow</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=105034926</id>
    <updated>2018-03-08T23:19:37Z</updated>
    <published>2018-03-08T23:19:37Z</published>
    <summary type="html">Can you try removing the Imports from the bnd.bnd file. Those should be taken care of by Gradle since we have them declared as dependencies. Let me know if this works.</summary>
    <dc:creator>Eddie Chow</dc:creator>
    <dc:date>2018-03-08T23:19:37Z</dc:date>
  </entry>
  <entry>
    <title>Moved to general Liferay Portal Development forums.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=104970343" />
    <author>
      <name>Kyle Joseph Stiemann</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=104970343</id>
    <updated>2018-03-07T18:03:33Z</updated>
    <published>2018-03-07T18:03:33Z</published>
    <summary type="html">Moved to Home » Liferay Portal » English » 3. &lt;a href="https://web.liferay.com/community/forums/-/message_boards/category/239390"&gt;Development&lt;/a&gt;.</summary>
    <dc:creator>Kyle Joseph Stiemann</dc:creator>
    <dc:date>2018-03-07T18:03:33Z</dc:date>
  </entry>
  <entry>
    <title>java.lang.ClassNotFoundException: com.liferay.util.ContentUtil</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=104952435" />
    <author>
      <name>Sudhanshu Kumar Shukla</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=104952435</id>
    <updated>2018-03-07T12:21:44Z</updated>
    <published>2018-03-07T12:21:44Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Develoeprs,&lt;br&gt;&lt;br&gt;&lt;br&gt;I Am Facing &lt;br&gt;&lt;br&gt;&lt;strong&gt;java.lang.ClassNotFoundException: com.liferay.util.ContentUtil And PortletProps&lt;/strong&gt;&lt;br&gt;&lt;br&gt;Below is my &lt;strong&gt;build.gradle&lt;/strong&gt; file&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;dependencies {
	compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"
	compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "2.0.0"
	compileOnly group: "com.liferay.portal", name: "com.liferay.util.java", version: "2.0.0"
	compileOnly group: 'com.liferay', name: 'com.liferay.content.util', version: '1.0.1'
	compileOnly group: 'com.liferay.portal', name: 'com.liferay.util.bridges', version: '2.0.1'
	compileOnly group: "com.liferay.portal", name: "com.liferay.portal.impl", version: "2.0.0"
	compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0"
	compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
	compileOnly group: "jstl", name: "jstl", version: "1.2"
	compileOnly group: "org.osgi", name: "osgi.cmpn", version: "6.0.0"
	compileOnly group: 'javax.mail', name: 'mail', version: '1.4.7'
	compileOnly project(":modules:BI_Enquiry-services:BI_Enquiry-services-api")
	compileOnly project(":modules:BI_Enquiry-services:BI_Enquiry-services-service")
}
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Here Is My &lt;strong&gt;bnd.bnd&lt;/strong&gt; file &lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;
Bundle-Name: BI_Enquiry-web
Bundle-SymbolicName: com.bumerguard.international
Bundle-Version: 1.0.0
Export-Package: com.bumerguard.international.constants
Import-Package: \
				!com.liferay.util; version="[7.0.0,8.0.0)",\
				!com.liferay.util.mail; version="[7.0.0,8.0.0)",\
				*
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Can Anybody Point Me where i am going wrong and what to do for using the utilites api's of liferay in dxp&lt;br&gt;&lt;br&gt;i know osgi provide all the dependencies at the run time but still i am getting this error.&lt;br&gt;&lt;br&gt;I am going wrong or is there any other way to use those dependencies.&lt;br&gt;&lt;br&gt;Thanks In Advanced.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Sudhanshu Kumar Shukla</dc:creator>
    <dc:date>2018-03-07T12:21:44Z</dc:date>
  </entry>
</feed>
