Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Liferay 7.2 CE GA1: comments in Asset Publisher Tpl without Alloy Editor
Alessandro Candini, modified 6 Years ago.
Regular Member
Posts: 130
Join Date: 10/17/15
Recent Posts
I've followed this guide to get comments inside an Asset Publisher Template, adapting it from JSP to FreeMarker:
Inside logs I can see that a NullPointerException is thrown:
Have you got any hint or workaround?
Thank you!
Edit: I've opened an issue for this topic.
<#assign discussionURL = renderResponse.createActionURL() />
${discussionURL.setParameter("javax.portlet.action", "invokeTaglibDiscussion")}
<@liferay_comment["discussion"]
className=entry.getClassName()
classPK=entry.getClassPK()
formAction=discussionURL?string
formName="fm" + entry.getClassPK()?string
ratingsEnabled=false
redirect=currentURL
userId=entry.getUserId()
/>This creates a partial version of comments component: the problem is that the Alloy Editor to insert a comment is missing!Inside logs I can see that a NullPointerException is thrown:
java.lang.NullPointerException
at com.liferay.taglib.ui.InputEditorTag$LazyDataInvocationHandler.invoke(InputEditorTag.java:598)
at org.apache.jsp.alloyeditor_jsp._jspService(alloyeditor_jsp.java:219)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:319)
at com.liferay.portal.osgi.web.servlet.jsp.compiler.internal.JspServlet.service(JspServlet.java:330)
at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:120)
at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.include(RequestDispatcherAdaptor.java:48)
at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:67)
at com.liferay.portal.servlet.DirectRequestDispatcherFactoryImpl$IndirectRequestDispatcher.include(DirectRequestDispatcherFactoryImpl.java:202)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:79)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.taglib.util.IncludeTag.includePage(IncludeTag.java:401)
at com.liferay.taglib.ui.InputEditorTag.includePage(InputEditorTag.java:459)
Debugging a little bit, I found that the issue seems to be at line 26 of modules/apps/frontend-editor/frontend-editor-alloyeditor-web/src/main/resources/META-INF/resources/alloyeditor.jsp:Map<string, object> data = (Map<string, object>)request.getAttribute(AlloyEditorConstants.ATTRIBUTE_NAMESPACE + ":data");
</string,></string,>I don't know if the problem is the assignment or casting to a Map but I cannot make a System.out.println() after that line.Have you got any hint or workaround?
Thank you!
Edit: I've opened an issue for this topic.