Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hebatu Allah Fahmy
liferay-ui:discussion custom portlet
April 1, 2013 1:36 AM
Answer

Hebatu Allah Fahmy

Rank: Junior Member

Posts: 41

Join Date: August 6, 2012

Recent Posts

I am trying to embed liferay-ui:discussion inside custom portlet
The problem is it throws g.ClassNotFoundException: org.apache.jsp.view_jsp because of the following
An error occurred at line: 119 in the jsp file: /discussion.jsp
The method setClassName(String) in the type DiscussionTag is not applicable for the arguments (Class<capture#2-of ? extends JournalArticle>)
 1
 2116:            id="journalCommentsPanel" persistState="<%= true %>"
 3117:            title='<%= LanguageUtil.get(pageContext, "Comments") %>'>
 4118:
 5119:            <liferay-ui:discussion
 6120:            className="<%= journal.getClass() %>"
 7121:            classPK="31575"
 8122:            formAction="www.google.com"
 97:55:57,957 ERROR [PortletRequestDispatcherImpl:108] org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.discussion_jsp
10rg.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.discussion_jsp
11       at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:177)
12       at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
13       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
14       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
15       at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
16       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
17       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
18       at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
19       at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:113)
20       at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:70)
21       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
22       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
23       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
24       at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593)
25       at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530)
26       at com.liferay.portlet.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:316)
27       at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:105)
28       at com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:366)
29       at com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:382)
30       at com.liferay.util.bridges.mvc.MVCPortlet.doView(MVCPortlet.java:145)
31       at com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:211)
32       at com.liferay.util.bridges.mvc.MVCPortlet.doDispatch(MVCPortlet.java:318)
33       at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)
34Caused by: java.lang.ClassNotFoundException: org.apache.jsp.view_jsp
35        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
36        at java.security.AccessController.doPrivileged(Native Method)
37        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
38        at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
39        at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
40        at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:130)
41        at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
42        ... 152 more


Here is my jsp
 1<portlet:defineObjects />
 2<liferay-theme:defineObjects />
 3
 4<%
 5WindowState windowState = null;
 6PortletMode portletMode = null;
 7
 8PortletURL currentURLObj = null;
 9
10if (renderRequest != null) {
11    windowState = renderRequest.getWindowState();
12    portletMode = renderRequest.getPortletMode();
13    currentURLObj = PortletURLUtil.getCurrent(renderRequest, renderResponse);
14}
15else if (resourceRequest != null) {
16    windowState = resourceRequest.getWindowState();
17    portletMode = resourceRequest.getPortletMode();
18    currentURLObj = PortletURLUtil.getCurrent(resourceRequest, resourceResponse);
19}
20
21String currentURL  = currentURLObj.toString();
22
23ThemeDisplay themeDisplayObject = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
24//long groupId = ParamUtil.getLong(request, "groupId", scopeGroupId);
25long groupId = themeDisplayObject.getScopeGroupId();
26String articleId = "31575";
27JournalArticle journal = JournalArticleLocalServiceUtil.getArticle(groupId,articleId);
28String url = PortalUtil.getCurrentURL(request);
29
30%>
31
32        <liferay-ui:panel-container extended="<%= false %>"
33        id="articleCommentsPanelContainer" persistState="<%= true %>">
34            <liferay-ui:panel collapsible="<%= true %>" extended="<%= true %>" id="articleCommentsPanel" persistState="<%= true %>"
35            title='<%= LanguageUtil.get(pageContext, "comments") %>'>
36                <portlet:actionURL var="discussionURL">
37                    <portlet:param name="myaction" value="invokeTaglibDiscussion" />
38                </portlet:actionURL>
39
40                <liferay-ui:discussion
41                    className="<%= JournalArticle.class.getName() %>"
42                    classPK="<%= journal.getArticleId() %>"
43                    formAction="<%= discussionURL %>"
44                    formName="fm2"
45                    ratingsEnabled="true"
46                    redirect="<%= currentURL %>"
47                    subject="<%= journal.getUrlTitle() %>"
48                    userId="<%= journal.getUserId() %>"
49                />
50            </liferay-ui:panel>
51       
52        </liferay-ui:panel-container>
53       


and here is my invokeTaglibDiscussion method :

 1public void invokeTaglibDiscussion(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
 2
 3        PortletConfig portletConfig = getPortletConfig();
 4    //    System.out.println(">>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>> inside invoke");
 5         PortalClassInvoker .invoke(true, "com.liferay.portlet.messageboards.action.EditDiscussionAction",      
 6                          "processAction", new String[] {
 7                                          "org.apache.struts.action.ActionMapping",
 8                                          "org.apache.struts.action.ActionForm",
 9                                          PortletConfig.class.getName(),
10                                          ActionRequest.class.getName(),
11                                         ActionResponse.class.getName()
12                          }, null, null, portletConfig, actionRequest, actionResponse);
13        }



where is the problem ?!!!!

all your feedback is highly appreciated .
Thanks in advance .
Hebatu Allah Fahmy
RE: Discussion tag
March 30, 2013 1:19 AM
Answer

Hebatu Allah Fahmy

Rank: Junior Member

Posts: 41

Join Date: August 6, 2012

Recent Posts

any suggestions ??