Ocorreu um erro ao processar o template.
Java method "com.sun.proxy.$Proxy1199.getArticleByUrlTitle(long, String)" threw an exception when invoked on com.sun.proxy.$Proxy1199 object "com.liferay.journal.service.impl.JournalArticleLocalServiceImpl@52bbbd8f"; see cause exception in the Java stack trace.
----
FTL stack trace ("~" means nesting-related):
- Failed at: #assign journalArticle = journalArtic... [in template "46661#46701#19643828" at line 7, column 1]
----
1<#assign journalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
2<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")>
3
4<#assign actualCategoryURLName = themeDisplay.getURLCurrent()?replace("/-/","")>
5
6
7<#assign journalArticle = journalArticleLocalService.getArticleByUrlTitle(themeDisplay.getScopeGroupId(),actualCategoryURLName) >
8<#assign assetEntry = assetEntryLocalService.fetchEntry("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()) >
9<#assign categoryName = assetEntry.getCategories()[0].getName()>
10<div class="ibd-blog__tags">
11 <h3>Tópicos relacionados</h3>
12
13 <#if entries?has_content>
14 <ul class="ibd-blog__cat-container">
15 <#list entries as navigationEntry>
16 <#if categoryName == navigationEntry.getName()>
17 <li>
18 <a href="${navigationEntry.getURL()}" class="ibd-blog__cat-select">${navigationEntry.getName()}</a>
19 </li>
20 </#if>
21 </#list>
22 </ul>
23 </#if>
24</div>
Ocorreu um erro ao processar o template.
The following has evaluated to null or missing:
==> JournalArticleLocalService.fetchArticleByUrlTitle(themeDisplay.getLayout().getGroupId(), actualURL) [in template "46661#46701#19643824" at line 8, column 20]
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: #assign journal = JournalArticleLocal... [in template "46661#46701#19643824" at line 8, column 1]
----
1<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService")>
2<#assign assetLinkLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetLinkLocalService")>
3<#assign assetEntryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")>
4<#assign assetCategoryServiceUtil = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")>
5<#assign freemarkerUtilities = serviceLocator.findService("com.iberdrola.liferay.freemarker.utilities.api.FreemarkerUtilities")>
6
7<#assign actualURL = themeDisplay.getURLCurrent()?replace("/-/","")>
8<#assign journal = JournalArticleLocalService.fetchArticleByUrlTitle(themeDisplay.getLayout().getGroupId(), actualURL)>
9<#assign articlePk = journal.getResourcePrimKey()?number>
10<#assign categories = assetCategoryServiceUtil.getCategories("com.liferay.journal.model.JournalArticle", articlePk)>
11
12<#if categories?has_content>
13 <#list categories as category>
14 <#assign categoryURL = category.getName()?replace("á","a")?replace("é","e")?replace("í","i")?replace("ó","o")?replace("ú","u")?replace(" ","-")/>
15 </#list>
16</#if>
17<#if !categoryURL??>
18 <#assign categoryURL = ""/>
19</#if>
20
21<#assign currentAssetEntry = assetEntryLocalService.fetchEntry("com.liferay.journal.model.JournalArticle", articlePk)>
22<#assign assetLinks = assetLinkLocalService.getLinks(currentAssetEntry.getEntryId())>
23
24<div class="ibd-blog__related">
25 <h3>Outros artigos que lhe podem interessar</h3>
26 <ul class="show-quick-actions-on-hover ibd-blog__related-content">
27
28 <#if assetLinks?has_content>
29 <#assign relatedCount = 0>
30 <#assign renderedIds = []>
31 <#list assetLinks as link>
32 <#if relatedCount < 3>
33 <#if link.getEntryId1()?string == currentAssetEntry.getEntryId()?string>
34 <#assign relatedEntryId = link.getEntryId2()>
35 <#else>
36 <#assign relatedEntryId = link.getEntryId1()>
37 </#if>
38
39 <#if !renderedIds?seq_contains(relatedEntryId?string)>
40 <#assign relatedAssetEntry = assetEntryLocalService.fetchEntry(relatedEntryId)>
41
42 <#if relatedAssetEntry?? && relatedAssetEntry.getClassName() == "com.liferay.journal.model.JournalArticle">
43 <#assign relatedJournal = JournalArticleLocalService.fetchLatestArticle(relatedAssetEntry.getClassPK())>
44
45 <#if relatedJournal??>
46 <#assign urlContent = "/blog/" + categoryURL?lower_case + "/" + relatedJournal.getUrlTitle()?lower_case>
47 <#assign docXml = saxReaderUtil.read(relatedJournal.getContentByLocale(locale))>
48 <#assign titulo = docXml.valueOf("//dynamic-element[@name='title']/dynamic-content/text()")>
49 <#assign descripcion = docXml.valueOf("//dynamic-element[@name='description']/dynamic-content/text()")>
50 <#assign stringPattern = "dd '" + languageUtil.get(locale, "of") + "' MMMM yyyy">
51 <#assign fechaModificacion = dateUtil.getDate(relatedJournal.getModifiedDate(), stringPattern, locale)>
52
53 <li class="ibd-blog__related-content-item">
54 <a class="ibd-blog__related-content-info autofit-col autofit-col-expand" href="${urlContent}">
55 <div class="ibd-blog__related-content-title-datetime">
56 <p class="ibd-blog__related-content-date list-group-subtitle">${fechaModificacion}</p>
57 </div>
58 <p class="ibd-blog__related-content-title h4 list-group-title text-truncate" title="${titulo}">
59 ${titulo}
60 </p>
61 <p class="ibd-blog__related-content-description list-group-subtitle text-truncate">${descripcion}</p>
62 </a>
63 <div class="autofit-col d-none"></div>
64 </li>
65 <#assign renderedIds = renderedIds + [relatedEntryId?string]>
66 <#assign relatedCount = relatedCount + 1>
67 </#if>
68 </#if>
69 </#if>
70 </#if>
71 </#list>
72 </#if>
73
74 </ul>
75</div>