6

I am configuring ambient data framework for Content Delivery web Service it is throwing below error when I hit my service url in browser

Server Error in '/' Application.


Cannot find claim processor implementation class: com.tridion.ambientdata.processing.ExampleClaimProcessor1 Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:

Com.Tridion.Ambientdata.AmbientDataException: Cannot find claim processor implementation class: com.tridion.ambientdata.processing.ExampleClaimProcessor1

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[AmbientDataException: Cannot find claim processor implementation class: com.tridion.ambientdata.processing.ExampleClaimProcessor1]
   Codemesh.JuggerNET.NTypeValue.Throw(Int64 inst) +373
   Codemesh.JuggerNET.JavaClass.ThrowTypedException(Int64 inst) +1364
   Codemesh.JuggerNET.JavaMethod.CallObject(JavaProxy jpo, JavaMethodArguments args) +524
   Com.Tridion.Ambientdata.EngineFactory.NewEngine(AmbientDataConfig ambientDataConfig) +126
   Tridion.ContentDelivery.AmbientData.HttpModule.InitializeAmbientFramework() +144
   Tridion.ContentDelivery.AmbientData.HttpModule.Init(HttpApplication application) +60
   System.Web.HttpApplication.InitModulesCommon() +172
   System.Web.HttpApplication.InitModules() +43
   System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +828
   System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +304
   System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +327

Below is my cd_ambient_cartridge_conf.xml file:

cd_ambient_cartridge_conf.xml

<?xml version="1.0" encoding="UTF-8"?>
<CartridgeDefinition Version="6.1" Uri="tcd:cartridge:example" Description="Example cartridge."
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="schemas/cd_ambient_cartridge_conf.xsd">
    <ClaimDefinitions>
        <ClaimDefinition Uri="tcd:claim:userid" Scope="SESSION" Description="The user's unique identifier." />
        <ClaimDefinition Uri="tcd:claim:username" Scope="SESSION" Description="The user's full name." />
        <ClaimDefinition Uri="tcd:claim:usersex" Scope="SESSION" Description="The user's sex (M or F)." />
        <ClaimDefinition Uri="tcd:claim:userage" Scope="SESSION" Description="The user's age in years." />
    </ClaimDefinitions>

    <ClaimProcessorDefinitions>
        <ClaimProcessorDefinition Uri="tcd:claimprocessor:example:userdetails" ImplementationClass="com.tridion.ambientdata.processing.ExampleClaimProcessor1"
                            Description="Example claim processor that gets user details.">
            <RequestStart>
                <InputClaims>
                    <ClaimDefinition Uri="tcd:claim:userid" />
                </InputClaims>
                <OutputClaims>
                    <ClaimDefinition Uri="tcd:claim:username" />
                    <ClaimDefinition Uri="tcd:claim:usersex" />
                    <ClaimDefinition Uri="tcd:claim:userage" />
                </OutputClaims>
            </RequestStart>
        </ClaimProcessorDefinition>

        <ClaimProcessorDefinition Uri="tcd:claimprocessor:example:example2"
                            ConfigProviderClass="com.tridion.ambientdata.processing.ExampleClaimProcessorConfigProvider" />
    </ClaimProcessorDefinitions>
</CartridgeDefinition>

Here is my cd_ambient_conf.xml file:

cd_ambient_conf.xml

<?xml version="1.0" encoding="UTF-8"?>
<Configuration Version="6.1"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schemas/cd_ambient_conf.xsd">


    <Cartridges>
        <Cartridge File="cd_ambient_cartridge_conf.xml"/>
        <Cartridge File="cd_webservice_preview_cartridge.xml"/>
        <!--

        -->
    </Cartridges>
    <!-- Cookies settings -->
    <!--
    <Cookies>
        <CookieClaim DefaultValue="true" Name="CookieClaim"/>
        <Cookie Type="Tracking" Name="myTrackingCookie" Path="/"/>
        <Cookie Type="Session" Name="mySessionCookie" Path="/"/>
    </Cookies>
    -->
</Configuration>

And here is the debug info in my log file for Content Delivery web Service:

Debug information in cd_core.2012-11-07.log

2012-11-07 05:00:11,421 DEBUG ServiceExtensionLoader - Loading extension points for interface com.tridion.webservices.extension.ODataServiceOperation.
2012-11-07 05:00:11,437 DEBUG ServiceExtensionLoader - Loading extension points for interface com.tridion.webservices.extension.ODataWritableEntryService.
2012-11-07 05:00:11,437 DEBUG ServiceExtensionLoader - Loading extension points from config file: jar:file:/C:/Program%20Files/Tridion/CDWebservice/bin/lib/cd_preview_webservice.jar!/META-INF/services/com.tridion.webservices.extension.ODataWritableEntryService.
2012-11-07 05:00:11,452 INFO  ODataWebserviceHandler - Adding OData writable entry service: WritablePageContentsEntryService.
2012-11-07 05:00:11,468 INFO  ODataWebserviceHandler - Adding OData writable entry service: WritableComponentPresentationsEntryService.
2012-11-07 05:00:11,468 INFO  ODataWebserviceHandler - Adding OData writable entry service: WritablePageMetasEntryService.
2012-11-07 05:00:11,468 INFO  ODataWebserviceHandler - Adding OData writable entry service: WritableComponentMetasEntryService.
2012-11-07 05:00:11,468 INFO  ODataWebserviceHandler - Adding OData writable entry service: WritableKeywordsEntryService.
2012-11-07 05:00:11,468 INFO  ODataWebserviceHandler - Adding OData writable entry service: WritableBinaryContentsEntryService.
2012-11-07 05:00:11,468 INFO  ODataWebserviceHandler - Adding OData writable entry service: WritableCustomMetasEntryService.
2012-11-07 05:00:11,468 INFO  ODataWebserviceHandler - Adding OData writable entry service: WritableBinaryVariantsEntryService.
2012-11-07 05:00:11,468 INFO  ODataWebserviceHandler - Adding OData writable entry service: WritableBinaryMetasEntryService.
2012-11-07 05:00:11,468 DEBUG ServiceExtensionLoader - Loading extension points for interface com.tridion.webservices.extension.ODataWritableStreamEntryService.
2012-11-07 05:00:11,468 DEBUG ServiceExtensionLoader - Loading extension points from config file: jar:file:/C:/Program%20Files/Tridion/CDWebservice/bin/lib/cd_preview_webservice.jar!/META-INF/services/com.tridion.webservices.extension.ODataWritableStreamEntryService.
2012-11-07 05:00:11,484 INFO  ODataWebserviceHandler - Adding OData writable entry service: WritableStreamBinaryContentsEntryService.
2012-11-07 05:00:11,484 INFO  JAXBContextResolver - Adding default JAXB types.
2012-11-07 05:00:11,484 DEBUG ServiceExtensionLoader - Loading extension points for interface com.tridion.webservices.extension.ODataEntryRegistrationService.
2012-11-07 05:00:11,484 DEBUG ServiceExtensionLoader - Loading extension points from config file: jar:file:/C:/Program%20Files/Tridion/CDWebservice/bin/lib/cd_preview_webservice.jar!/META-INF/services/com.tridion.webservices.extension.ODataEntryRegistrationService.
2012-11-07 05:00:11,484 INFO  JAXBContextResolver - Adding BinaryContents JAXB type.
2012-11-07 05:00:11,812 WARN  AmbientDataContext - There is no current ambient data context - the ambient data framework is not properly initialised
2012-11-07 05:00:11,812 DEBUG AmbientDataContext - Setting current ambient data context: com.tridion.ambientdata.web.WebContext

Any help would be much appreciated. Thanks in advance.

Edit-Regarding CDA application

Error on web page

Cannot find claim processor implementation class: com.tridion.ambientdata.processing.ExampleClaimProcessor1
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: Com.Tridion.Ambientdata.AmbientDataException: Cannot find claim processor implementation class: com.tridion.ambientdata.processing.ExampleClaimProcessor1

Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[AmbientDataException: Cannot find claim processor implementation class: com.tridion.ambientdata.processing.ExampleClaimProcessor1]
   Codemesh.JuggerNET.NTypeValue.Throw(Int64 inst) +373
   Codemesh.JuggerNET.JavaClass.ThrowTypedException(Int64 inst) +1364
   Codemesh.JuggerNET.JavaMethod.CallObject(JavaProxy jpo, JavaMethodArguments args) +524
   Com.Tridion.Ambientdata.EngineFactory.NewEngine(AmbientDataConfig ambientDataConfig) +126
   Tridion.ContentDelivery.AmbientData.HttpModule.InitializeAmbientFramework() +144
   Tridion.ContentDelivery.AmbientData.HttpModule.OnRequestStart(Object sender, EventArgs e) +68
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

cd_ambient_conf.xml

<?xml version="1.0" encoding="UTF-8"?>
<Configuration Version="6.1"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:noNamespaceSchemaLocation="schemas/cd_ambient_conf.xsd">

    <Cartridges>

        <Cartridge File="cd_webservice_preview_cartridge.xml"/>
        <Cartridge File="footprint_cartridge_conf.xml"/>


    </Cartridges>
  <ClaimStoreProvider>com.tridion.siteedit.preview.PreviewClaimStoreProvider</ClaimStoreProvider>
    <!-- Cookies settings -->
    <!--
    <Cookies>
        <CookieClaim DefaultValue="true" Name="CookieClaim"/>
        <Cookie Type="Tracking" Name="myTrackingCookie" Path="/"/>
        <Cookie Type="Session" Name="mySessionCookie" Path="/"/>
    </Cookies>
    -->
</Configuration>

cd_ambient_cartridge_conf.xml

<?xml version="1.0" encoding="UTF-8"?>
<CartridgeDefinition Version="6.1" Uri="tcd:cartridge:example" Description="Example cartridge."
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="schemas/cd_ambient_cartridge_conf.xsd">
    <ClaimDefinitions>
        <ClaimDefinition Uri="tcd:claim:userid" Scope="SESSION" Description="The user's unique identifier." />
        <ClaimDefinition Uri="tcd:claim:username" Scope="SESSION" Description="The user's full name." />
        <ClaimDefinition Uri="tcd:claim:usersex" Scope="SESSION" Description="The user's sex (M or F)." />
        <ClaimDefinition Uri="tcd:claim:userage" Scope="SESSION" Description="The user's age in years." />
    </ClaimDefinitions>

    <ClaimProcessorDefinitions>
        <ClaimProcessorDefinition Uri="tcd:claimprocessor:example:userdetails" ImplementationClass="com.tridion.ambientdata.processing.ExampleClaimProcessor1"
                            Description="Example claim processor that gets user details.">
            <RequestStart>
                <InputClaims>
                    <ClaimDefinition Uri="tcd:claim:userid" />
                </InputClaims>
                <OutputClaims>
                    <ClaimDefinition Uri="tcd:claim:username" />
                    <ClaimDefinition Uri="tcd:claim:usersex" />
                    <ClaimDefinition Uri="tcd:claim:userage" />
                </OutputClaims>
            </RequestStart>
        </ClaimProcessorDefinition>

        <ClaimProcessorDefinition Uri="tcd:claimprocessor:example:example2"
                            ConfigProviderClass="com.tridion.ambientdata.processing.ExampleClaimProcessorConfigProvider" />
    </ClaimProcessorDefinitions>
</CartridgeDefinition>

Error in log file

2012-11-07 14:36:31,962 WARN  AmbientDataContext - There is no current ambient data context - the ambient data framework is not properly initialised
2012-11-07 14:36:31,962 DEBUG AmbientDataContext - Setting current ambient data context: com.tridion.ambientdata.web.WebContext
2012-11-07 14:36:32,071 ERROR XMLConfigurationReader - Error while validating file 'cd_ambient_conf.xml' with schema 'schemas/cd_ambient_conf.xsd'. cvc-complex-type.2.4.a: Invalid content was found starting with element 'ClaimStoreProvider'. One of '{Cookies}' is expected.

As error says , one of Cookies expected , but in documentation nowhere it is mentioned. Thanks in Advance .

NOTE- This Error comes and when I refresh page again it goes away and page works fine.I mean it comes in alternative page hit.

chiku
  • 383
  • 1
  • 12

1 Answers1

8

Please remove (or comment out) in the 'cd_ambient_conf.xml' configuration file the cartridge called:

<Cartridge File="cd_ambient_cartridge_conf.xml"/>

Note that this cartridge is just an example and should not be used in production. That cartridge contains example definitions which do not exist causing you ClassNotFoundException.

Hope this helps.

Regards, Daniel.

Daniel Neagu
  • 1,711
  • 11
  • 13
  • Thanks for your helps, error for CD service has been resolved by doing so . But i am getting same issue in my CDA application .Can I remove ClaimProcessorDefinition as they are optional. do I need any ClaimProcessorDefinition in my scenerio. Please find my edit in the question and advise. – chiku Nov 08 '12 at 06:59
  • @chiku: If your CDA application is a staging application then you need to have enabled (on that specific web app!!!) the following Cartridges: ' and '. This also means that in the lib folder of that CDA application you need to have the jar files 'cd_preview_ambient.jar', 'cd_preview_web.jar', 'cd_session.jar', 'footprint_cartridge.jar' and 'se_ambientpreview.jar'. In your case you should not get the same exception because the claim definition for 'ExampleClaimProcessor1' is not in there. – Daniel Neagu Nov 08 '12 at 10:11
  • @Daniel , yes these jar files are already in the lib folder . I am surprised that why it only throw error in first page request and disappears in the page refresh. and now I am experiencing it not come in every alternate hit. it comes randomly any time. – chiku Nov 08 '12 at 11:12
  • @chiku: Interesting...I get the feeling that you're sharing the appPools between your webApp. If that is the case then please make sure that each webApp has it's own application pool. Can you please check this? – Daniel Neagu Nov 08 '12 at 13:27
  • @Daniel ,Yeah there are two websites which runs in same app pool. but in both Ambient framework is configured in same way. let me seperate them through app pool. hope something in favour :-) thanks a lot – chiku Nov 08 '12 at 14:14