I have configured UGC for a JSP website and I am getting the following error in the generated DCP. It seems to be looking for HEADER_USER_ID.
org.apache.jasper.JasperException: An exception occurred processing JSP page /data/pub10/dcp/jsp/dcp295_4952.jsp at line 42
42: <ugc:Comments itemURI="tcm:10-4952">
43: <ol>
44: <ugc:ForEachComment> <li>
java.lang.NoSuchFieldError: HEADER_USER_ID
com.tridion.ugc.taglib.webservice.WebServiceClient.addHeaders(WebServiceClient.java:237)
com.tridion.ugc.taglib.webservice.WebServiceClient.getResponse(WebServiceClient.java:94)
com.tridion.ugc.taglib.webservice.CommentsRetriever.retrieveComments(CommentsRetriever.java:152)
com.tridion.ugc.taglib.UGCCommentsTag.doStartTag(UGCCommentsTag.java:97)
org.apache.jsp.data.pub10.dcp.jsp.dcp295_005f4952_jsp._jspx_meth_ugc_005fComments_005f0(dcp295_005f4952_jsp.java:171)
org.apache.jsp.data.pub10.dcp.jsp.dcp295_005f4952_jsp._jspService(dcp295_005f4952_jsp.java:147)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
com.tridion.ambientdata.web.AmbientDataServletFilter.doFilter(AmbientDataServletFilter.java:255)
Below is the source of one of the published DCPs. UGC is working in the CMS GUI. I can view/add/edit comments on contents thru the Comments tab. However I am unable to get it to work on the presentation side.
<%@ page import="java.util.*, java.io.*, java.sql.*, utilClassesV3.*, adminV3.tridion.*,
jxl.*, jxl.write.*, admin.*, tags.*, com.tridion.linking.*, com.tridion.web.jsp.JSPPage,
com.tridion.dynamiccontent.ComponentPresentationAssembler" %>
<%@ page import="org.apache.lucene.analysis.*, org.apache.lucene.analysis.standard.StandardAnalyzer, org.apache.lucene.document.*,
org.apache.lucene.index.*, org.apache.lucene.search.*, org.apache.lucene.queryparser.analyzing.*,
java.net.URLEncoder, SiteSearch.*, org.apache.lucene.analysis.CachingTokenFilter,
org.apache.lucene.analysis.TokenStream, org.apache.lucene.index.memory.MemoryIndex,
org.apache.lucene.search.highlight.*, org.apache.lucene.store.FSDirectory, org.apache.lucene.store.Directory,
org.apache.lucene.store.SimpleFSDirectory" %>
<%@ taglib uri="cbktags" prefix="CBK"%>
<%@ taglib uri="ugc" prefix="ugc"%>
<%@ taglib uri="jstltags" prefix="c"%>
<%@ taglib uri="tridiontags" prefix="tridion"%>
<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%
request.setCharacterEncoding("UTF-8");
Link link = null;
PageLink pageLink = new PageLink(10);
BinaryLink binaryLink = null, rootBinaryLink = null;
BinaryLink enBinaryLink = null, arBinaryLink = null, frBinaryLink = null;
PageLink enPageLink = null, arPageLink = null, frPageLink = null;
binaryLink = new BinaryLink(10);
rootBinaryLink = new BinaryLink(9);
enBinaryLink = new BinaryLink(10);
enPageLink = new PageLink(10);
arBinaryLink = new BinaryLink(11);
arPageLink = new PageLink(11);
ComponentLink componentLink = new ComponentLink(10);
String linkAsString = "", tempString = "", strTCMPageId = "", siteLanguage="en";
int publicationId=10;
strTCMPageId = (String)session.getAttribute("TCMPageId");
if (strTCMPageId == null || strTCMPageId.length() == 0)
strTCMPageId = "";
ComponentPresentationAssembler cpAssembler;
cpAssembler = new ComponentPresentationAssembler(new JSPPage(pageContext, strTCMPageId));
%>
<ugc:Comments itemURI="tcm:10-4952">
<ol>
<ugc:ForEachComment>
<li>
<ugc:Choose>
<ugc:When test="ugcUser equals ugcComment.User.Id">
<!-- If the user is the comment author, show a form to edit the comment -->
<form method="post" id="editCommentForm">
<input type="hidden" name="commentIdtcm:10-4952" value=""/>
<textarea rows="4" cols="30" name="editCommenttcm:10-4952"></textarea><br/>
<input type="submit" value="Save comment"/>
</form>
</ugc:When>
<ugc:Otherwise>
<!-- If this visitor did not submit this comment, simply display it. -->
</ugc:Otherwise>
</ugc:Choose>
<br/>
</li>
</ugc:ForEachComment>
</ol>
</ugc:Comments>
As you see the generated DCP doesn't show code for comment.content
or comment.id
Has anyone come across this?
UPDATE 21/1/2013
Okay, so the reason why I was getting the above error was because I used ugc_taglib.jar
from hotfix #2 and the remaining jars from 2011 SP1. Once I replaced all the jars from the hotfix, the error is gone.