你调用的对象是空的。在sitecore

时间:2014-07-04 10:51:30

标签: sitecore nullreferenceexception sitecore7.2

我将在本地环境中开发的所有sitecore数据移动到Amazon Web Service的服务器 我附加了数据库。设置IIS。并重写连接字符串 但它不起作用。当我访问首页时,我看到了这样的错误页面。

  

描述:执行当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。

     

异常详细信息:System.NullReferenceException:未将对象引用设置为对象的实例。

     

来源错误:   在执行当前Web请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪来识别有关异常的起源和位置的信息。

堆栈追踪:

[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

本地环境

  • windows 7
  • SQL Server 2012 sp1
  • IIS 7.5
  • Sitecore版本7.2

AWS环境

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

我已经尝试过这一页(tracking NullReferenceExceptions in sitecore) 但是这些技术在这种情况下不起作用。 如果有人知道,请告诉我怎么做。 谢谢。

1 个答案:

答案 0 :(得分:2)

这消除了异常的原因:

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

其中一个配置包含文件(/App_Config/Include)中有错误 那里可能存在一些格式错误的XML。

还要确保其中没有*.Debug.config*.Release.config个文件。