RE: FreeMarker staticUtil breaks after upgrade from 7.2.0 GA1 to 7.2.1 GA2

thumbnail
Alessandro Candini, modified 5 Years ago. Regular Member Posts: 130 Join Date: 10/17/15 Recent Posts
Hi everyone!
On Liferay 7.2.0 CE GA1, inside a Web Content Template we had the following import of static constants:
WorkflowConstants = staticUtil["com.liferay.portal.kernel.workflow.WorkflowConstants"]
After an upgrade to Liferay 7.2.1 CE GA2, this snippets does not work anymore and the error reported is the following:
java.lang.ClassNotFoundException: com.liferay.portal.kernel.workflow.WorkflowConstants cannot be found by com.liferay.portal.template.freemarker_5.0.16
With other imports, for example
 WindowState = staticUtil["javax.portlet.WindowState"]
, everything seems working as before, we got this error only for WorkflowConstants.
Any ideas or workaround on how to solve this?
Thank you.
thumbnail
Alberto Chaparro, modified 5 Years ago. Liferay Master Posts: 560 Join Date: 4/25/11 Recent Posts
Hi Alessandro,
Can you try with other classes in portal-kernel? it seems that the template can't see this jar somehow.
thumbnail
Alessandro Candini, modified 5 Years ago. Regular Member Posts: 130 Join Date: 10/17/15 Recent Posts
Hi Alberto, I've solved in this way:
<#assign STATUS_APPROVED = staticFieldGetter.getFieldValue("com.liferay.portal.kernel.workflow.WorkflowConstants", "STATUS_APPROVED")/> 
thumbnail
Alberto Chaparro, modified 5 Years ago. Liferay Master Posts: 560 Join Date: 4/25/11 Recent Posts
Great!
Thanks Alessandro for documenting it :-)