Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 6.1.0 CE GA1
-
Fix Version/s: 6.1.1 CE GA2
-
Component/s: WCM > Web Content Administration
-
Labels:None
-
Environment:liferay 6.1.0 tomcat bundle
-
Liferay Contributor's Agreement:Accept
-
Similar Issues:
Description
We implementing own portlet - this portlet shoudl display web-content by specified articleId.
So, to do it we are using followed code:
<%
JournalArticleDisplay articleDisplay = JournalContentUtil.getDisplay(themeDisplay.getScopeGroupId(), String.valueOf(articleId), null, themeDisplay.getLanguageId(), themeDisplay);
%>
<%= displayArticle == null ? StringPool.BLANK : displayArticle.getContent() %>
this works fine for normal articles - but in case we are trying to display template driven article - we always got null from getDisplay method.
Issue Links
- duplicates
-
LPS-18364
AssetRenderer fails for Journal/Web Content utilising template when embeded in custom portlet due to incorrect class loader
-
Activity
Alexey Kakunin
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Contributed Solution [ 10001 ] |
| Company Name | EmDev Limited | |
| Liferay Contributor's Agreement | Accept [ 10033 ] |
Alexey Kakunin
made changes -
| Status | Contributed Solution [ 10001 ] | Community Resolved [ 10009 ] |
Mika Koivisto
made changes -
Mika Koivisto
made changes -
| Status | Community Resolved [ 10009 ] | Resolved [ 5 ] |
| Assignee | SE Support [ support-lep@liferay.com ] | Mika Koivisto [ koivimik ] |
| Resolution | Duplicate [ 3 ] |
Michael Saechang
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
| Fix Version/s | 6.1.1 CE GA2 [ 11326 ] |
Michael Saechang
made changes -
| Verified By: | koivimik |
Andrew Kim
made changes -
| Workflow | LPS Workflow [ 294158 ] | Copy of LPS Workflow [ 430955 ] |
Andrew Kim
made changes -
| Workflow | Copy of LPS Workflow [ 430955 ] | LPS Workflow [ 462563 ] |
Andrew Kim
made changes -
| Workflow | LPS Workflow [ 462563 ] | Copy 2 of LPS Workflow [ 494938 ] |
Andrew Kim
made changes -
| Workflow | Copy 2 of LPS Workflow [ 494938 ] | LPS Workflow [ 526824 ] |
Randy Zhu
made changes -
| Workflow | LPS Workflow [ 526824 ] | PUBLIC - LPS Generic Workflow [ 578790 ] |
Randy Zhu
made changes -
| Workflow | PUBLIC - LPS Generic Workflow [ 578790 ] | Copy of PUBLIC - LPS Generic Workflow [ 613090 ] |
Randy Zhu
made changes -
| Workflow | Copy of PUBLIC - LPS Generic Workflow [ 613090 ] | PUBLIC - LPS Generic Workflow [ 645018 ] |
| Transition | Time In Source Status | Execution Times | Last Executer | Last Execution Date | |||||
|---|---|---|---|---|---|---|---|---|---|
|
3m 59s | 1 | Alexey Kakunin | 08/Mar/12 1:46 PM | |||||
|
6s | 1 | Alexey Kakunin | 08/Mar/12 1:46 PM | |||||
|
326d 4h 1m | 1 | Mika Koivisto | 28/Jan/13 5:48 PM | |||||
|
2m 24s | 1 | Michael Saechang | 28/Jan/13 5:50 PM |

Problem in com.liferay.portal.kernel.templateparser.BaseTransformer class - in method transform it creates templateParser (actually com.liferay.portlet.journal.util.VelocityTemplateParser) with using current thread classloader - which is plugins classloader - and failed (since this class is from portal-impl and not available fro plugins).
To fix this bug we need to use portal's classloader and change code in lines starting from 143 to:
if (Validator.isNotNull(templateParserClassName)) {
TemplateParser templateParser = null;
// Fix for
LPS-25992ClassLoader classLoader =
PortalClassLoaderUtil.getClassLoader();
try
{ templateParser = (TemplateParser)InstanceFactory.newInstance(classLoader, templateParserClassName); }catch (Exception e)
{ throw new TransformException(e); }