Error in configuring ambient data framework for Content Delivery web Service

假装没事ソ 提交于 2020-01-03 09:08:18

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/13263631/error-in-configuring-ambient-data-framework-for-content-delivery-web-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!