1

I am experimenting with DD4T 2. I'm getting the the latest alphas of everything from NuGet, and I've selected Autofac as my DI system.

When I start the application with a request for /, I get an exception, which appears to be thrown from the following code in TridionControllerBase.

[HandleError]
public virtual ActionResult Page(string url)
{
    url = AddWelcomePageToUrl(url);
    IPage page = GetPage(url);
    if (page == null) { throw new HttpException(404, "Page cannot be found"); }
    return View(GetViewName(page), page);
}

In the broker database, my root page is index.aspx. I have tried adding a DD4T.WelcomeFile appSetting, but this doesn't help. My debugging session is a bit iffy, but it's fairly clear that page is evaluating to null. (url is already null by the time my PageController gets invoked.) What might be the cause of this, and how can I further investigate?

  • How about some info around the basics, what does url contain at the time of this request, and is there a corresponding page in the broker for that? – Bart Koopman May 18 '16 at 7:48
  • Not 100% sure how DD4T handles this, but I guess if url is null, then AddWelcomePageToUrl(url) hopefully turns that into index.aspx. But without debugging working it's not really precision guess work, so not my cup of tea ;o). Maybe add another question about your issues with debugging, surely that shouldn't be so difficult to setup? – Bart Koopman May 18 '16 at 8:28
1

It turned out that the problem was with connecting to the content service. I had configured the discovery service url in my web.config, but it turns out that you need various oauth-client- settings as well.

I also needed to specify DD4T.WelcomeFile and DD4T.PublicationId. Here is the relevant part of my web.config

<add key="DD4T.WelcomeFile" value="index.aspx" />
<add key="DD4T.PublicationId" value="15" />
<add key="discovery-service-uri" value="http://dd4t.local:8082/discovery.svc" />
<add key="cid-service-proxy-pattern" value="/cid*" />
<add key="service-caching" value="false" />
<add key="service-caching-expiration" value="60" />
<add key="oauth-enabled" value="true" />
<add key="oauth-client-id" value="cduser" />
<add key="oauth-client-secret" value="CDUserP@ssw0rd" /> 

(Note that as it's my own dev server I am running the microservices with the out-of-the-box security configuration, so you don't need to worry that I'm disclosing highly secure passwords!)

| improve this answer | |
  • Your passwords are showing! :) – Albert Romkes May 20 '16 at 9:52
  • I already mentioned that these are the OOTB passwords. Nothing to worry about. Thanks. – Dominic Cronin May 20 '16 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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