1

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

  • windows 7
  • SQL Server 2012 sp1
  • IIS 7.5
  • Sitecore version 7.2

AWS environment

  • Windows Server R2 Standard
  • SQL Server 2012 Express sp1
  • IIS 8.5
  • Sitecore version 7.2

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.

Community
  • 1
  • 1
user3804625
  • 13
  • 1
  • 1
  • 3
  • I never encountered your problem but there is a blog post that might help you http://sitecorebasics.wordpress.com/2013/10/29/the-type-initializer-for-sitecore-diagnostics-loggerfactory-threw-an-exception/ – nsgocev Jul 04 '14 at 10:56
  • Are you using lucene search in your site? – Yogesh Sharma Jul 04 '14 at 12:36

1 Answers1

2

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.

Ruud van Falier
  • 8,765
  • 5
  • 30
  • 59