6

I am trying to fetch the UGC comments from the DB using the below code snippet

var lstComment = CommentsRetriever.RetrieveComments("tcm:2033-4732-64", true, true, true, true, true, true, true, 100, 0);

While executing this statement I am getting the following exception:

Could  not initialize class com.tridion.storage.ugc.UGCConfigurationLoader
================================================
  Some configured classpath roots cannot be found
================================================

ClassPath           : C:\DemoProject\DemoProject\bin\bin
ClassPath           : C:\DemoProject\DemoProject\bin\bin
ClassPath           : C:\DemoProject\DemoProject\bin\bin
ClassPath           : C:\DemoProject\DemoProject\bin\bin
ClassPath           : C:\DemoProject\DemoProject\bin\bin
ClassPath           : C:\DemoProject\DemoProject\bin\bin
ClassPath           : C:\DemoProject\DemoProject\bin\bin
ClassPath           : C:\DemoProject\DemoProject\bin\bin
ClassPath           : C:\DemoProject\DemoProject\bin\bin 
============================================================
 Some Java classes or interfaces could not be found or loaded

  The most typical reasons for this problem are:

 - you forgot to configure a classpath
 - a jarfile, zipfile, or directory is missing from your  classpath
 - you have a typo in one of your classpath entries
 - a jarfile required by one of your classes is missing from  your classpath
 - a jarfile on your classpath is out-of-date and does not contain some new classes
  ============================================================

                  com.tridion.smarttarget.analytics.tracking.TrackingRedirect
              javax.servlet.jsp.tagext.TagSupport
              com.tridion.smarttarget.tags.NavigationSectionFooterTagHandler
              com.tridion.web.jsp.JSPProcessor
              com.tridion.smarttarget.tags.PromotionTagHandler
              javax.servlet.ServletException
              com.tridion.smarttarget.tags.QueryTagHandler
              com.tridion.smarttarget.tags.SearchTagHandler
              com.tridion.smarttarget.tags.NavigationLinkTagHandler
              com.tridion.web.jsp.ResponseWrapper
              com.tridion.smarttarget.tags.PromotionsTagHandler
              com.tridion.smarttarget.tags.ItemContentTagHandler
              com.tridion.linking.Linking
              com.tridion.smarttarget.tags.AttributeTagHandler
              com.tridion.smarttarget.tags.ItemsHeaderTagHandler
              com.tridion.smarttarget.tags.ItemTagHandler
              javax.servlet.jsp.JspException
              com.tridion.linking.ASPLinking
              com.tridion.storage.ugc.UGCValidationFacade
              javax.servlet.jsp.tagext.BodyTagSupport
              com.tridion.smarttarget.tags.ItemTemplateTagHandler
              com.tridion.smarttarget.tags.NavigationSectionTagHandler
              com.tridion.smarttarget.tags.PromotionalItemsTagHandler
              com.tridion.ambientdata.web.AmbientDataServletFilter
              com.tridion.smarttarget.tags.ItemsTagHandler
              com.tridion.smarttarget.tags.AttributeValueTagHandler
              com.tridion.smarttarget.tags.FacetTagHandler
              com.tridion.marketingsolution.profilesync.Handler
              com.tridion.smarttarget.tags.NavigationTagHandler
              com.tridion.webservices.security.authentication.OAuth2AccessTokenHandler
              com.tridion.smarttarget.tags.ItemContentInfoTagHandler
              com.tridion.storage.ugc.UGCConfigurationLoader
              com.tridion.web.jsp.JSPXSLTProcessor
              com.tridion.smarttarget.tags.FallbackContentTagHandler
              com.tridion.smarttarget.tags.NavigationSectionHeaderTagHandler
              com.tridion.smarttarget.tags.PromotionContentTagHandler
              javax.servlet.jsp.tagext.BodyTag
              javax.servlet.GenericServlet
              javax.servlet.http.HttpServletResponse
              javax.servlet.jsp.tagext.Tag
              javax.servlet.jsp.JspWriter
              javax.servlet.Servlet
              javax.servlet.http.HttpServlet
              javax.servlet.ServletResponse
              javax.servlet.jsp.jstl.core.LoopTag
              javax.servlet.jsp.jstl.core.LoopTagSupport
              javax.servlet.ServletConfig
              javax.servlet.jsp.tagext.TryCatchFinally
              javax.servlet.jsp.tagext.IterationTag
              javax.servlet.ServletRequest
              javax.servlet.jsp.PageContext
              javax.servlet.http.HttpSession
              javax.servlet.http.HttpServletRequest

The error occurs after calling the UGC functions the rest of the features are working fine.

I have added all the jars related to UGC in my project\bin\lib folder. Also the CD_licensee file is working fine [As some have recommended it may be due to expired cd_license for similar type of error.]

I am using Tridion 2013 sp1 and the Java version is 1.7.0_71. Please help.

UPDATE-1

cd_ugc_conf.xml::

   <?xml version="1.0" encoding="UTF-8"?>
    <Configuration Version="7.1"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:noNamespaceSchemaLocation="schemas/cd_ugc_conf.xsd">
<!--Optional:-->
 <Comment>
    <!-- The minimum threshold of a score before it gets flagged for moderation. -->
    <ScoreMinimumThreshold>-10</ScoreMinimumThreshold>
    <!-- HTML white list -->
    <Whitelist>
        <!-- Allow a link. -->
        <Tag Name="a">
            <!-- Allow a link's href attribute. -->
            <Attribute Name="href">
                <!-- Allow a link's href attribute to link to the http protocol. -->
                <Protocol Name="http"/>
            </Attribute>
            <!-- Set attribute 'rel' to value 'nofollow'. -->
            <Attribute Name="rel" EnforcedValue="nofollow"/>
            <!-- Set attribute 'target' to value '_blank'. -->
            <Attribute Name="target" EnforcedValue="_blank"/>
        </Tag>
        <!-- Allow bold. -->
        <Tag Name="b"/>
        <!-- Allow line break. -->
        <Tag Name="br"/>
        <!-- Allow italic. -->
        <Tag Name="i"/>
        <!-- Allow underlined. -->
        <Tag Name="u"/>
    </Whitelist>
 </Comment> 
 <ODataEndpoint URL="http://localhost:88/odata.svc">    
 </ODataEndpoint>
</Configuration>

And the app setting values I have added are:

  <add key="ODataEndPoint.URL" value="http://localhost:88/odata.svc/"/>
  <add key="ODataEndPoint.ConnectionTimeout" value="20000"/>
  <add key="ODataEndPoint.ReadTimeout" value="20000"/>

In the Odata endpoint value I have added the moderate service url.

UPDATE-2

I checked all the configurations, and I followed as per Tridion Docs. The only thing I was able fix is Some configured classpath roots cannot be found by adding a folder named bin inside the \project\bin folder.

Below are my UGC related config files

ugc_ambient_catridges.xml

<?xml version="1.0" encoding="UTF-8"?>
<CartridgeDefinition Version="7.1" Uri="tcd:cartridge:ugc" Description="UGC cartridge."
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:noNamespaceSchemaLocation="schemas/cd_ambient_cartridge_conf.xsd">
    <ClaimDefinitions>
        <ClaimDefinition Uri="taf:claim:contentdelivery:webservice:post:allowed" Scope="REQUEST"
                         Description="A flag where a POST is allowed to the UGC OData entities."/>
        <ClaimDefinition Uri="taf:claim:contentdelivery:webservice:user" Scope="REQUEST"
                         Description="The user posting to the OData service."/>
      <ClaimDefinition Uri="taf:claim:tracking:internalcontactid" Scope="REQUEST"
                         Description="The Audience Manager internal contact id."/>
        <ClaimDefinition Uri="taf:claim:tracking:updatedcontact:xml" Scope="REQUEST"
                         Description="The Audience Manager updated contact xml."/> 
    </ClaimDefinitions>

    <ClaimProcessorDefinitions>
        <!-- Allows anonymous posts. Disable when using a login system.  -->
        <ClaimProcessorDefinition Uri="taf:claimprocessor:webservice:ugc:anonymous"
                                  ImplementationClass="com.tridion.ugc.odata.claimprocessor.AllowAnonymousPostClaimProcessor"
                                  Description="Claim processor that allows an anonymous post.">
            <RequestStart>
                <OutputClaims>
                    <ClaimDefinition Uri="taf:claim:contentdelivery:webservice:user"/>
                </OutputClaims>
            </RequestStart>
        </ClaimProcessorDefinition>

        <!-- Post allowed by owners.  -->

        <ClaimProcessorDefinition Uri="taf:claimprocessor:webservice:ugc:post"
                                  ImplementationClass="com.tridion.ugc.odata.claimprocessor.PostAllowedByOwnerClaimProcessor"
                                  Description="Claim processor that determines if a post is allowed by checking if the user is the owner.">
            <RequestStart>
                <InputClaims>
                    <ClaimDefinition Uri="taf:claim:contentdelivery:webservice:user"/>
                </InputClaims>
                <OutputClaims>
                    <ClaimDefinition Uri="taf:claim:contentdelivery:webservice:post:allowed"/>
                </OutputClaims>
            </RequestStart>
        </ClaimProcessorDefinition>


        <!-- Post allowed by everyone. -->
        <!--
        <ClaimProcessorDefinition Uri="taf:claimprocessor:webservice:ugc:post"
                                  ImplementationClass="com.tridion.ugc.odata.claimprocessor.PostAllowedByEveryoneClaimProcessor"
                                  Description="Claim processor that allows a post.">
            <RequestStart>
                <InputClaims>
                    <ClaimDefinition Uri="taf:claim:contentdelivery:webservice:user"/>
                </InputClaims>
                <OutputClaims>
                    <ClaimDefinition Uri="taf:claim:contentdelivery:webservice:post:allowed"/>
                </OutputClaims>
            </RequestStart>
        </ClaimProcessorDefinition>
        -->
    </ClaimProcessorDefinitions>
</CartridgeDefinition>

cd_ambient_conf.xml

    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    <Configuration Version="7.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schemas/cd_ambient_conf.xsd">
      <ExcludedPaths>
        <!--For Java -->
        <!--<Path>/httpupload</Path>
            <Path>/access_token</Path>-->
        <!--For .NET -->
        <!--<Path>/httpupload.aspx</Path>
            <Path>/access_token.svc</Path>-->
      </ExcludedPaths>
      <Cartridges>    
        <Cartridge File="cd_webservice_preview_cartridge.xml"/>
        <Cartridge File="footprint_cartridge_conf.xml"/>
        <Cartridge File="session_cartridge_conf.xml"/>    
        <Cartridge File="/audiencemanager_cartridge_conf.xml"/>
        <Cartridge File="ugc_ambient_cartridge.xml"/>
      </Cartridges>
    </Configuration>

Every time my application calls the UGC functions, I get the error related to smart Target.is there any configuration change related to UGC required in the smart Target configs.

I have also tried with removing all the smart Target changes from my application. still I am getting these smart target related errors. Is there any sample solution available that has used the tridion UGC?

5
  • The problem seems to be the absence of the "cd_ugc_conf.xml" file. Feb 26, 2016 at 13:03
  • @ Raúl Escudero :The cd_ugc_conf.xml file is already present in the dd4t solution.
    – Manas.p
    Feb 28, 2016 at 17:25
  • there are lots of question on this topic e.g tridion.stackexchange.com/questions/6025/… check if any help. also you dll and jars are 32/64 depending upon your machine.
    – Raj Kumar
    Feb 29, 2016 at 8:28
  • 2
    @RajKumar : As I have mentioned, the solution is working for rest of the functionality. Only for UGC functions I am getting the errors. The jars and dlls I have copied from the Tridion Content delivery folder. Is there anything I am missing in the cd_UGC_Confg.xml. [I have updated the question]
    – Manas.p
    Feb 29, 2016 at 9:28
  • "com.tridion.smarttarget.analytics.tracking.TrackingRedirect" do you have your libary/JAR to resolve it. this looks also susceptible in your stack trace
    – Raj Kumar
    Feb 29, 2016 at 11:56

1 Answer 1

2

The issue must be related to either you are missing a JAR files or missing a configuration entry in the config files. I would suggest, you ensure checking the JARs and config at the right place - I hope in your case, this should most likely be the your Website's Bin\Config and probably not the Moderation service.

Further, you may follow below blog post and double check your setup and configuration of UGC:

Also, check if you can retrieve comments for the page in the CME.

1
  • I have also used your blog as reference for implementing UGC. In my case the UGC is working from CME. I can add/ edit/delete the comments from CME. Also I have added all the jars present in the ..\Content Delivery\roles\ugc\java\lib , ..\Content Delivery\roles\ugc\java\third-party-libfolder and the dlls from the ..\Content Delivery\roles\ugc\dotNet\x86_64 ..
    – Manas.p
    Feb 29, 2016 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.