4

I have installed the Tridion content delivery web service on a 64 bit Windows Server 2008 R2 system, intending to configure UGC. (In fact I have two services, which both exhibit the same problem).

My service has the ambient framework HttpModule configured, and the cd_ambient_conf.xml is a copy of the default version shipped with the product, however the Security element is commented out. I am testing by visiting the odata.svc endpoint in the browser.

In the Cartridges element, I have the following:

<Cartridges>
        <Cartridge File="cd_ambient_cartridge_conf.xml"/>
        <Cartridge File="ugc_ambient_cartridge.xml"/> 
</Cartridges>

When configured like this, or if I comment out the cd_ambient cartridge and leave the ugc_ambient cartridge in, I get a null reference exception:

[NullReferenceException: Object reference not set to an instance of an object.]
Tridion.ContentDelivery.AmbientData.HttpModule.OnRequestStart
                                                (Object sender, EventArgs e) +292
System.Web.SyncEventExecutionStep.System.Web
                                    .HttpApplication.IExecutionStep.Execute() +79
System.Web.HttpApplication.ExecuteStep(
                       IExecutionStep step, Boolean& completedSynchronously) +269

If I configure only the cd_ambient cartridge, then I get the following error:

[AmbientDataException: Error while configuring ambient data framework]

If I remove both cartridges, the service comes up without an error. I'm speculating that the null reference errors are caused by perhaps a missing configuration value, but at least cd_ambient_conf.xml passes schema validation, so perhaps not.

So... what is likely to be the cause of this problem, and are there any debugging or analysis techniques that may help me to find out more?

EDIT: I have now removed the cd_ambient_cartridge_conf.xml reference from within Cartridges. So with only the ugc_ambient_cartridge.xml reference, I get the following error in the cd_core log (and I'm back to getting the [AmbientDataException: Error while configuring ambient data framework] error):

2012-05-11 15:03:51,073 WARN  AmbientDataContext - There is no current ambient 
       data context - the ambient data framework is not properly initialised
2012-05-11 15:03:51,171 ERROR EngineFactory - Unable to configure the 
                                                       AmbientData Framework
com.tridion.configuration.ConfigurationException: 
   Can't find configuration file: [ ugc_ambient_cartridge.xml ]
at         com.tridion.configuration.XMLConfigurationReader.readConfiguration(
                                XMLConfigurationReader.java:92) ~[cd_core.jar:na]
at         com.tridion.ambientdata.AmbientDataConfig.getCartridgeConfigurations(
                                 AmbientDataConfig.java:155) ~[cd_ambient.jar:na]
at com.tridion.ambientdata.EngineFactory.newEngine(
                                      EngineFactory.java:45) ~[cd_ambient.jar:na]
Dominic Cronin
  • 670
  • 4
  • 21

1 Answers1

3

It's probably the cd_ambient_cartridge_conf.xml that contains errors. The default cartridge is shipped as an example of what you could do with a custom cartridge.

Remove that cartridge from your cd_ambient_conf.xml and try again.

The null reference exception probably means you're missing jars and/or configuration for UGC. Check the Tridion logs for additional info on this.

UPDATE

This is what I have in my UGC-enabled website:

In Web.Config (only relevant parts shown):

<appSettings>
    <add key="webpages:Version" value="1.0.0.0"/>
    <add key="ClientValidationEnabled" value="true"/>
    <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
    <add key="ODataEndpoint.URL" value="http://localhost:903/odata.svc"/>
    <add key="ODataEndpoint.ConnectionTimeout" value="20000"/>
    <add key="ODataEndpoint.ReadTimeout" value="20000"/>
</appSettings>
[...]
<controls>
    <add tagPrefix="tridion" namespace="Tridion.ContentDelivery.Web.UI" assembly="Tridion.ContentDelivery"/>
    <add tagPrefix="ugc" namespace="Tridion.ContentDelivery.UGC.Web.UI" assembly="Tridion.ContentDelivery.UGC" />
</controls>
[...]
<modules runAllManagedModulesForAllRequests="true">
  <add type="Tridion.ContentDelivery.AmbientData.HttpModule" name="AmbientFrameworkModule" preCondition="managedHandler" />
</modules>

In /bin:

  • Tridion.ContentDelivery.AmbientData.dll
  • Tridion.ContentDelivery.UGC.dll

(Plus the standard ones)

In /bin/config/cd_ambient_conf.xml:

<Cartridges>
    <Cartridge File="ugc_ambient_cartridge.xml"/>
</Cartridges>

In /bin/config/cd_ugc_conf.xml:

<ODataEndpoint URL="http://localhost:903/odata.svc" />

Everything else in this file is what was there by default.

In /bin/lib, UGC related:

  • ucg_tcdl.jar
  • ugc_webservice.jar
  • ugc_dynamic.jar
  • ugc_model.jar
  • ugc_storage.jar
  • ugc_taglib.jar
  • cd_ambient.jar
Nuno Linhares
  • 545
  • 3
  • 11
  • Thanks Nuno. I've now updated the question giving the log output. As you can see, it's not telling me much. – Dominic Cronin May 11 '12 at 13:11
  • Can't find configuration file: [ ugc_ambient_cartridge.xml ] --> You're missing a jar file and _possibly_ your Http Module is not in the web.config? – Nuno Linhares May 11 '12 at 13:34
  • I have ugc_dynamic.jar, ugc_model.jar, ugc_storage.jar, ugc_taglib.jar, ugc_tcdl.jar and ugc_webservice.jar, plus lots of others not beginning with ugc. The http module is configured in the web.config. – Dominic Cronin May 11 '12 at 14:22
  • I'm convinced that this is a good line of enquiry. I just need to know which jar might contain this missing resource. – Dominic Cronin May 11 '12 at 15:47
  • 2
    It turns out that what was missing was not a JAR file but an XML resource that needed to be loaded from the file system, as described in the "Configuring the UGC Cartridge in the Content Delivery Web services" section in the documentation. – Dominic Cronin May 11 '12 at 16:52