3

We have CMS environment as Web 8.5, delivery as 2013 sp1 and Broker DB is SQL server 2016. The application uses DD4T 2.0 RestApi.

I have published my Page from Web 8.5 to broker db 2013 sp1 using legacy Deployer.

I am trying to get the Page using the method GetPage("pageurl") and when I am trying to read my Page, it gives a Null Reference Exception:

GlobalExceptionLogger  Log  - Unhandled Exception (Object reference not set to an instance of an object.): 'http://domainurl/page/GetContentByUrl/32/htm/somepage/index' 
System.NullReferenceException:  Object reference not set to an instance of an object. at
DD4T.Providers.SDLTridion2013sp1.TridionPageProvider.GetContentByUrl(String Url) in C:\projects\dd4t-providers-sdltridion2013sp1\source\DD4T.Providers.SDLTridion2013sp1\TridionPageProvider.cs:line 128    at
DD4T.RestService.WebApi.Controllers.PageController.GetContentByUrl(Int32 publicationId, String extension, String url) in
C:\projects\dd4t-restservice\source\DD4T.RestService.WebApi\Controllers\PageController.cs:line 41    at
lambda_method(Closure , Object , Object[] )    at
System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)    at
System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---    at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at
System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---    at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at
System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---    at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at
System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()

2 Answers 2

1

The TridionPageProvider does quite a bit of logging when your logger is configured in Debug mode. Seeing any of these messages might help you detect where the null object reference is.

I'd suspect though some kind of licence or Tridion CD confiuration/set-up error is stopping the Query object from being initialised.

Have you confirmed your Tridion CD set-up - http://www.tridiondeveloper.com/how-tridion-content-delivery-loads-configuration-files-in-dotnet ?

0

Yes Neil , I did a further investigation on the cd_core logs and found this :

ERROR Query - Unable to Configure for BrokerQuerying, query DAO could not be retrieved com.tridion.broker.StorageException: No Data Access Object Factory for defaultdb.

So, this meant the configuration of cd_storage_config has some missing pieces related to storage IDs . Therefore , after adding those details needed, the API gave me the correct response .

1
  • Great - can you accept my answer then and move yours to a comment on mine?
    – Neil
    Apr 25, 2018 at 7:43

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.