<?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>Debugging velocity template</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=17344785" />
  <subtitle>Debugging velocity template</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=17344785</id>
  <updated>2026-07-04T15:26:07Z</updated>
  <dc:date>2026-07-04T15:26:07Z</dc:date>
  <entry>
    <title>RE: Debugging velocity template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=77540172" />
    <author>
      <name>Fernando Fernandez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=77540172</id>
    <updated>2016-08-09T16:52:44Z</updated>
    <published>2016-08-09T16:52:44Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div class="quote-title"&gt;James Falkner:&lt;/div&gt;&lt;blockquote&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;#set ($logFactory = $portal.getClass().forName('com.liferay.portal.kernel.log.LogFactoryUtil'))
#set ($log = $logFactory.getLog('mylog'))
$log.error($msgCount)
$log.error("Hi There")
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;/blockquote&gt;&lt;br&gt;&lt;br&gt;In 6.2 CE GA6 we get "Cannot retrieve method forName from object of class java.lang.Class due to security restrictions."&lt;br&gt;&lt;br&gt;Any ideas?&lt;br&gt;&lt;br&gt;Thanks &lt;br&gt;&lt;br&gt;Fernando&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Fernando Fernandez</dc:creator>
    <dc:date>2016-08-09T16:52:44Z</dc:date>
  </entry>
  <entry>
    <title>RE: Debugging velocity template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=20650498" />
    <author>
      <name>Michel Wicky</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=20650498</id>
    <updated>2013-01-13T16:09:43Z</updated>
    <published>2013-01-13T16:09:43Z</published>
    <summary type="html">Hello Hitoshi, i tested the velocity debugging but was not able to obtain any result. I was testing it using LR 6.1 EE and putted the macro into VM_liferay.vm in portal-impl.jar.&lt;br /&gt;I used the script without $context.&lt;br /&gt;&lt;br /&gt;Here is the vm script i would like to debug with #showDebugPopup macro call :&lt;br /&gt;&lt;br /&gt;#set ($isOkinawaLogged = $request.get(&amp;#34;remote-user&amp;#34;))&lt;br /&gt;#if ($isOkinawaLogged != &amp;#39;&amp;#39;)&lt;br /&gt;    #set ($userFullName = $user.getFullName())&lt;br /&gt;    &amp;lt;h1&amp;gt;Bonjour $userFullName&amp;lt;/h1&amp;gt;&lt;br /&gt;    &amp;lt;p&amp;gt;Félicitations ! Vous participez à l&amp;#39;action bénévole des associations suivantes :&amp;#39;&amp;lt;/p&amp;gt;&lt;br /&gt;    &amp;lt;li&amp;gt;&lt;br /&gt;        #foreach ($my_site_text IN $my_sites_text )&lt;br /&gt;            &amp;lt;ul&amp;gt;($my_site_text.getName())&amp;lt;/ul&amp;gt;&lt;br /&gt;        #end&lt;br /&gt;    &amp;lt;/li&amp;gt;&lt;br /&gt;#else&lt;br /&gt;    &amp;lt;div class=&amp;#34;portlet-msg-alert&amp;#34;&amp;gt;&lt;br /&gt;        &amp;lt;h1&amp;gt;Bonjour cher visiteur, chère visiteuse&amp;lt;/h1&amp;gt;&lt;br /&gt;        &amp;lt;p&amp;gt;Vous ne participez pas encore à l&amp;#39;action bénévole des associations affiliées au projet Okinawa. Nous nous réjouissons de vous accueillir très prochainement et vous compter bientôt parmi nous.&amp;lt;/p&amp;gt;&lt;br /&gt;        &amp;lt;p&amp;gt;Vous trouverez ici la liste des associations auxquelles vous aurez adhérées.&amp;lt;/p&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;#end&lt;br /&gt;#showDebugPopup()&lt;br /&gt;&lt;br /&gt;Do you see something wrong ?&lt;br /&gt;&lt;br /&gt;Note i&amp;#39;m able to debug a little bit with org.apache.velocity setted to debug, but it&amp;#39;s not really sufficient.&lt;br /&gt;&lt;br /&gt;Thank youz</summary>
    <dc:creator>Michel Wicky</dc:creator>
    <dc:date>2013-01-13T16:09:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: Debugging velocity template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=17571553" />
    <author>
      <name>Balaji Chopparapu</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=17571553</id>
    <updated>2012-10-30T15:40:09Z</updated>
    <published>2012-10-30T15:40:09Z</published>
    <summary type="html">Thanks James. This is really useful hint.</summary>
    <dc:creator>Balaji Chopparapu</dc:creator>
    <dc:date>2012-10-30T15:40:09Z</dc:date>
  </entry>
  <entry>
    <title>RE: Debugging velocity template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=17379531" />
    <author>
      <name>Siby Mathew</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=17379531</id>
    <updated>2012-10-23T09:20:28Z</updated>
    <published>2012-10-23T09:20:28Z</published>
    <summary type="html">Really useful information....Thanks for the code ! &lt;img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" &gt;</summary>
    <dc:creator>Siby Mathew</dc:creator>
    <dc:date>2012-10-23T09:20:28Z</dc:date>
  </entry>
  <entry>
    <title>RE: Debugging velocity template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=17367417" />
    <author>
      <name>Hitoshi Ozawa</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=17367417</id>
    <updated>2012-10-22T21:49:25Z</updated>
    <published>2012-10-22T21:49:25Z</published>
    <summary type="html">I only know of Velocity Debugging Template and using logging.&lt;br /&gt;&lt;br /&gt;http://wiki.apache.org/velocity/VelocityDebuggingTemplate</summary>
    <dc:creator>Hitoshi Ozawa</dc:creator>
    <dc:date>2012-10-22T21:49:25Z</dc:date>
  </entry>
  <entry>
    <title>RE: Debugging velocity template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=17363731" />
    <author>
      <name>James Falkner</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=17363731</id>
    <updated>2012-10-22T19:25:50Z</updated>
    <published>2012-10-22T19:25:50Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div class="quote-title"&gt;Balaji Chopparapu:&lt;/div&gt;&lt;blockquote&gt;Hi,&lt;br&gt;How can I debug velocity template that is assigned to a structure and webcontent ?  Till now I am printing all variables and doing debugging in a rude way.  Can I use eclipse or any other IDE to debug velocity template?&lt;br&gt;&lt;br&gt;Thanks in Advance,&lt;br&gt;Balaji&lt;/blockquote&gt;&lt;br&gt;&lt;br&gt;I do not know of any IDE that would let you, for example, set breakpoints in Velocity code and debug it - I've always used printing variables and such.  One thing you may be interested in is how to emit debug information to the log file:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;#set ($logFactory = $portal.getClass().forName('com.liferay.portal.kernel.log.LogFactoryUtil'))
#set ($log = $logFactory.getLog('mylog'))
$log.error($msgCount)
$log.error("Hi There")
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;If you find a better way, let me know!&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>James Falkner</dc:creator>
    <dc:date>2012-10-22T19:25:50Z</dc:date>
  </entry>
  <entry>
    <title>Debugging velocity template</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=17344784" />
    <author>
      <name>Balaji Chopparapu</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=17344784</id>
    <updated>2012-10-22T09:57:04Z</updated>
    <published>2012-10-22T09:57:04Z</published>
    <summary type="html">Hi,&lt;br /&gt;How can I debug velocity template that is assigned to a structure and webcontent ?  Till now I am printing all variables and doing debugging in a rude way.  Can I use eclipse or any other IDE to debug velocity template?&lt;br /&gt;&lt;br /&gt;Thanks in Advance,&lt;br /&gt;Balaji</summary>
    <dc:creator>Balaji Chopparapu</dc:creator>
    <dc:date>2012-10-22T09:57:04Z</dc:date>
  </entry>
</feed>
