<?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>Unable to run groovy script from a custom portlet</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119870042" />
  <subtitle>Unable to run groovy script from a custom portlet</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119870042</id>
  <updated>2026-04-07T01:38:27Z</updated>
  <dc:date>2026-04-07T01:38:27Z</dc:date>
  <entry>
    <title>Unable to run groovy script from a custom portlet</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119870041" />
    <author>
      <name>Rajesh Chaurasia</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119870041</id>
    <updated>2020-09-01T00:41:22Z</updated>
    <published>2020-09-01T00:41:22Z</published>
    <summary type="html">2020-09-01 05:23:00.408 ERROR [pool-21-thread-1][ScriptRunnerExecutionHistoryBusiness:140] null&lt;br /&gt;com.liferay.portal.kernel.scripting.ScriptingException: startup failed:__Script1.groovy: 3: unable to resolve class com.liferay.journal.model.JournalArticleDisplay_ @ line 3, column 1.__   import com.liferay.journal.model.JournalArticleDisplay;__   ^____Script1.groovy: 1: unable to resolve class com.liferay.registry.RegistryUtil_ @ line 1, column 1.__   import com.liferay.registry.RegistryUtil;__   ^____Script1.groovy: 2: unable to resolve class com.liferay.journal.model.JournalArticle_ @ line 2, column 1.__   import com.liferay.journal.model.JournalArticle;__   ^____3 errors___Line 1: import com.liferay.registry.RegistryUtil;_Line 2: import com.liferay.journal.model.JournalArticle;_Line 3: import com.liferay.journal.model.JournalArticleDisplay;_Line 4: def jalocalservice = RegistryUtil.getRegistry().getService(&amp;#34;com.liferay.journal.service.JournalArticleLocalService&amp;#34;);_Line 5: _Line 6: def articles = jalocalservice.getArticles();_Line 7: for (JournalArticle at:articles) {_Line 8:     out.println(&amp;#34;article Name:${at.getUrlTitle()}&amp;#34;);_Line 9: }_ [Sanitized]&lt;br /&gt;    at com.liferay.portal.scripting.internal.ScriptingImpl.eval(ScriptingImpl.java:92)&lt;br /&gt;    at com.liferay.portal.kernel.scripting.ScriptingUtil.eval(ScriptingUtil.java:45)&lt;br /&gt;    at com.hp.pfp.scriptrunner.business.ScriptRunnerExecutionHistoryBusiness.executeScript(ScriptRunnerExecutionHistoryBusiness.java:125)&lt;br /&gt;    at com.hp.pfp.scriptrunner.business.ScriptExecutionThread.run(ScriptExecutionThread.java:34)&lt;br /&gt;    at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:752)&lt;br /&gt;    at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:664)&lt;br /&gt;    at java.lang.Thread.run(Thread.java:748)&lt;br /&gt;Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:__Script1.groovy: 3: unable to resolve class com.liferay.journal.model.JournalArticleDisplay_ @ line 3, column 1.__   import com.liferay.journal.model.JournalArticleDisplay;__   ^____Script1.groovy: 1: unable to resolve class com.liferay.registry.RegistryUtil_ @ line 1, column 1.__   import com.liferay.registry.RegistryUtil;__   ^____Script1.groovy: 2: unable to resolve class com.liferay.journal.model.JournalArticle_ @ line 2, column 1.__   import com.liferay.journal.model.JournalArticle;__   ^____3 errors__ [Sanitized]&lt;br /&gt;    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)&lt;br /&gt;    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:946)</summary>
    <dc:creator>Rajesh Chaurasia</dc:creator>
    <dc:date>2020-09-01T00:41:22Z</dc:date>
  </entry>
</feed>
