user3804625
user3804625

Reputation: 13

Object reference not set to an instance of an object. in sitecore

I moved all of the sitecore data developed in our local environment to the Amazon Web Service's Server.
I attached database. setting IIS. and rewrote connection strings.
But it doesn't work. I saw error page like this when I access top page.

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: System.NullReferenceException: Object reference not set to an instance of an object.

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:

[NullReferenceException: Object reference not set to an instance of an object.]
   Sitecore.Diagnostics.Log.Error(String message, Exception exception, Type ownerType) +246
   Sitecore.Configuration.Factory.LoadAutoIncludeFiles(ConfigPatcher patcher, String folder) +1064
   Sitecore.Configuration.Factory.GetConfiguration() +331
   Sitecore.Diagnostics.LoggerFactory..cctor() +58

[TypeInitializationException: The type initializer for 'Sitecore.Diagnostics.LoggerFactory' threw an exception.]
   Sitecore.Diagnostics.LoggerFactory.GetLogger(Type type) +28
   Sitecore.Diagnostics.Log.Error(String message, Exception exception, Type ownerType) +150
   Sitecore.Configuration.Factory.LoadAutoIncludeFiles(ConfigPatcher patcher, String folder) +1065
   Sitecore.Configuration.Factory.GetConfiguration() +332
   Sitecore.Configuration.Factory.GetConfigNode(String xpath, Boolean assert) +117
   Sitecore.Resources.Media.UploadWatcher.InitializeIgnoreList() +182

[TypeInitializationException: The type initializer for 'Sitecore.Resources.Media.UploadWatcher' threw an exception.]
   Sitecore.Resources.Media.UploadWatcher..ctor() +0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +159
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +256
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +127
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +14407909
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +198
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +83
   System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1 moduleList) +334
   System.Web.HttpApplication.GetModuleCollection(IntPtr appContext) +1262
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +133
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12601936
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12441597

Local environment

AWS environment

I have tried all the way written in this page(tracking NullReferenceExceptions in sitecore) but these techniques doesn't work in this case. Please tell me how to do, if someone knows. Thank you.

Upvotes: 1

Views: 13180

Answers (1)

Ruud van Falier
Ruud van Falier

Reputation: 8877

This gives away the cause of the exception:

Sitecore.Configuration.Factory.LoadAutoIncludeFiles(ConfigPatcher patcher, String folder) +1064
Sitecore.Configuration.Factory.GetConfiguration() +331

You have an error in one of the config include files (/App_Config/Include)
There is probably some malformed XML in there somewhere.

Also make sure there are no *.Debug.config or *.Release.config files in there.

Upvotes: 2

Related Questions