Orchard.Layouts does not display all elements - orchardcms

Sometimes something happens and orchard layouts module starts incorrect working:
When I edit a content item that layout part does not display any layout element and canvas area.
When i view a content item that layout part does not display some layout elements, ex. projection elements.
In such cases I enable and disable output cache module that orchard layouts module starts correct working again.
I posted this message also to codeplex https://orchard.codeplex.com/workitem/21305 It is a critical error which prevents the normal working of production site. May be you have any idea what i should do?
One of the errors that got into the log
2015-03-31 09:08:38,594 [93] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - Default - NullReferenceException thrown from IContentPartDriver by Orchard.Layouts.Drivers.LayoutPartDriver
System.NullReferenceException: Object reference not set to an instance of an object.
в Orchard.Layouts.Services.ElementFactory.Activate(ElementDescriptor descriptor, Action`1 initialize)
в Orchard.Layouts.Services.ElementManager.ActivateElement(ElementDescriptor descriptor, Action`1 initialize)
в Orchard.Layouts.Services.ContentModelMap.ToElement(IElementManager elementManager, DescribeElementsContext describeContext, JToken node)
в Orchard.Layouts.Services.LayoutModelMapper.LoadElement(JToken node, Container parent, Int32 index, DescribeElementsContext describeContext)
в Orchard.Layouts.Services.LayoutModelMapper.ParseEditorNode(JToken node, Container parent, Int32 index, DescribeElementsContext describeContext)
в Orchard.Layouts.Services.LayoutModelMapper.<>c__DisplayClass10.<ParseEditorNode>b__d(JToken x, Int32 i)
в System.Linq.Enumerable.<SelectIterator>d__7`2.MoveNext()
в System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
в System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
в System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
в Orchard.Layouts.Services.LayoutModelMapper.ParseEditorNode(JToken node, Container parent, Int32 index, DescribeElementsContext describeContext)
в Orchard.Layouts.Services.LayoutModelMapper.<>c__DisplayClass10.<ParseEditorNode>b__d(JToken x, Int32 i)
в System.Linq.Enumerable.<SelectIterator>d__7`2.MoveNext()
в System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
в System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
в System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
в Orchard.Layouts.Services.LayoutModelMapper.ParseEditorNode(JToken node, Container parent, Int32 index, DescribeElementsContext describeContext)
в Orchard.Layouts.Services.LayoutModelMapper.<>c__DisplayClass10.<ParseEditorNode>b__d(JToken x, Int32 i)
в System.Linq.Enumerable.<SelectIterator>d__7`2.MoveNext()
в System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
в System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
в System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
в Orchard.Layouts.Services.LayoutModelMapper.ParseEditorNode(JToken node, Container parent, Int32 index, DescribeElementsContext describeContext)
в Orchard.Layouts.Services.LayoutModelMapper.<>c__DisplayClass10.<ParseEditorNode>b__d(JToken x, Int32 i)
в System.Linq.Enumerable.<SelectIterator>d__7`2.MoveNext()
в System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
в System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
в System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
в Orchard.Layouts.Services.LayoutModelMapper.ParseEditorNode(JToken node, Container parent, Int32 index, DescribeElementsContext describeContext)
в Orchard.Layouts.Services.LayoutModelMapper.<ToLayoutModel>d__6.MoveNext()
в System.Linq.Buffer`1..ctor(IEnumerable`1 source)
в System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
в Orchard.Layouts.Drivers.LayoutPartDriver.<>c__DisplayClass12.<Editor>b__11()
в Orchard.ContentManagement.Drivers.ContentPartDriver`1.<>c__DisplayClass15.<ContentShape>b__14(BuildShapeContext ctx) в d:\sites\orchard sites\rpa-mu.ru-2-new\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 196
в Orchard.ContentManagement.Drivers.ContentPartDriver`1.<>c__DisplayClass1b.<ContentShapeImplementation>b__1a(BuildShapeContext ctx) в d:\sites\orchard sites\rpa-mu.ru-2-new\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 205
в Orchard.ContentManagement.Drivers.ContentShapeResult.ApplyImplementation(BuildShapeContext context, String displayType) в d:\sites\orchard sites\rpa-mu.ru-2-new\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 45
в Orchard.ContentManagement.Drivers.ContentShapeResult.Apply(BuildEditorContext context) в d:\sites\orchard sites\rpa-mu.ru-2-new\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs: line 25
в Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator.<>c__DisplayClass10.<UpdateEditor>b__f(IContentPartDriver driver) в d:\sites\orchard sites\rpa-mu.ru-2-new\src\Orchard\ContentManagement\Drivers\Coordinators\ContentPartDriverCoordinator.cs:line 65
в Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) в d:\sites\orchard sites\rpa-mu.ru-2-new\src\Orchard\InvokeExtensions.cs:line 17

Related

Sitecore Azure Error : Instance validation error: '2014-06.2.4' is not a valid value for SchemaVersion

When I click on Sitecore Azure module from my Sitecore desktop I'm getting bellow given error. I've Sitecore SDK 2.9 installed
Instance validation error: '2014-06.2.4' is not a valid value for SchemaVersion.
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.InvalidOperationException: Instance validation error: '2014-06.2.4' is not a valid value for SchemaVersion.
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:
[InvalidOperationException: Instance validation error: '2014-06.2.4' is not a valid value for SchemaVersion.]
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderServiceDefinition.Read68_SchemaVersion(String s) +123
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderServiceDefinition.Read71_ServiceDefinition(Boolean isNullable, Boolean checkType) +585
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderServiceDefinition.Read72_ServiceDefinition() +116
[InvalidOperationException: There is an error in XML document (2, 147).]
System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) +857
System.Xml.Serialization.XmlSerializer.Deserialize(TextReader textReader) +159
Sitecore.Azure.Deployments.AzureDeployments.Deployment.LoadData() +568
Sitecore.Azure.Deployments.AzureDeployments.AzureDeployment.LoadData() +17
Sitecore.Azure.Deployments.AzureEntity..ctor(AzureEntity parentNode, Item storeItem) +196
Sitecore.Azure.Deployments.AzureDeployments.ContentDeliveryDeployment..ctor(WebRole parentNode, DeploymentItem item) +30
Sitecore.Azure.Deployments.EntitiesFactory.Create(Item item, AzureEntity parent) +2431
Sitecore.Azure.Deployments.AzureEntity..ctor(AzureEntity parentNode, Item storeItem) +334
Sitecore.Azure.Deployments.EntitiesFactory.Create(Item item, AzureEntity parent) +1581
Sitecore.Azure.Deployments.AzureEntity..ctor(AzureEntity parentNode, Item storeItem) +334
Sitecore.Azure.Deployments.EntitiesFactory.Create(Item item, AzureEntity parent) +1464
Sitecore.Azure.Deployments.AzureEntity..ctor(AzureEntity parentNode, Item storeItem) +334
Sitecore.Azure.Deployments.EntitiesFactory.Create(Item item, AzureEntity parent) +1881
Sitecore.Azure.Deployments.AzureEntity..ctor(AzureEntity parentNode, Item storeItem) +334
Sitecore.Azure.Deployments.Environments.Environment..ctor(AzureEntity parentNode, EnvironmentDefinition environmentDefinition, EnvironmentItem item) +41
Sitecore.Azure.Deployments.EntitiesFactory.Create(Item item, AzureEntity parent) +2292
Sitecore.Azure.Deployments.AzureEntity..ctor(AzureEntity parentNode, Item storeItem) +334
Sitecore.Azure.Configuration.Settings.get_EnvironmentsRoot() +150
Sitecore.Azure.Managers.AzureManagers.TrafficProfilesManager.GetGlobalDomainURIs() +76
Sitecore.Azure.UI.Shell.Applications.Azure.AzureManagerForm.TrafficManagerInitialising(String environmnentType, DeploymentSlot slot, String& startupScript) +124
Sitecore.Azure.UI.Shell.Applications.Azure.AzureManagerForm.OnLoad(EventArgs e) +159
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +128
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj) +89
Sitecore.Web.UI.Sheer.ClientPage.OnLoad(EventArgs e) +594
System.Web.UI.Control.LoadRecursive() +68
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4498
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0
Fixed it by searching in sitecore for 2014-06.2.4 and replacing this value with 2015-04.2.6

Failed to find or load the registered .Net Framework Data Provider on local machine

I am receiving an error message "Failed to find or load the registered .Net Framework Data Provider." with Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write
public void Write(string message, string category)
{
Logger.Write(message, category);
}
Source File: Logger.cs Line: 42
Stack Trace:
[ConfigurationErrorsException: Failed to find or load the registered .Net Framework Data Provider.]
System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow) +1480973
System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +88
Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetDefaultMapping(String dbProviderName) +64
Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetProviderMapping(String dbProviderName, DatabaseSettings databaseSettings) +43
Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetDatabaseData(ConnectionStringSettings connectionString, DatabaseSettings databaseSettings) +28
Microsoft.Practices.EnterpriseLibrary.Data.Configuration.<get_Databases>d__0.MoveNext() +272
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +439
System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
Microsoft.Practices.EnterpriseLibrary.Data.Configuration.<DoGetRegistrations>d__10.MoveNext() +137
System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +85
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +381
System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetRegistrations(IConfigurationSource configurationSource) +161
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.TypeLoadingLocator.<GetRegistrations>b__0(ITypeRegistrationsProvider p, IConfigurationSource cs) +8
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.TypeLoadingLocator.GetRegistrationsInternal(IConfigurationSource configurationSource, Func`3 registrationAccessor) +74
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.TypeLoadingLocator.GetRegistrations(IConfigurationSource configurationSource) +80
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.CompositeTypeRegistrationsProviderLocator.<GetRegistrations>b__0(ITypeRegistrationsProvider l, IConfigurationSource cs) +8
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.<>c__DisplayClass5.<GetRegistrationsInternal>b__4(ITypeRegistrationsProvider l) +16
System.Linq.<SelectManyIterator>d__14`2.MoveNext() +234
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.Unity.UnityContainerConfigurator.RegisterAllCore(IConfigurationSource configurationSource, ITypeRegistrationsProvider rootProvider) +159
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ChangeTrackingContainerConfigurator.RegisterAll(IConfigurationSource configurationSource, ITypeRegistrationsProvider rootProvider) +23
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.ConfigureContainer(ITypeRegistrationsProvider locator, IContainerConfigurator configurator, IConfigurationSource configSource) +19
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.ConfigureContainer(IContainerConfigurator configurator, IConfigurationSource configSource) +117
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.CreateDefaultContainer(IConfigurationSource configurationSource) +59
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.SetCurrentContainerIfNotSet() +80
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.get_Current() +5
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.get_Writer() +73
Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(Object message, String category) +16
Any help will be appreciated.

nhibernate CurrentSessionContext.Hasbind giving object reference not set

Hi i m using WebApi Mvc4 framework .net 4.0
I create a sessionFactory as follows:
public void ConfigureNHibernate(IKernel container)
{
var sessionFactory = FluentNHibernate
.Cfg.Fluently.Configure()
.Database(
MsSqlConfiguration.MsSql2008.ConnectionString(
c => c.FromConnectionStringWithKey("ApikeysDb")))
.CurrentSessionContext("web")
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<CTP.ApiNext.Data.SqlServer.SqlCommandFactory>())
.BuildSessionFactory();
// Add the ISessionFactory instance to the container
container.Bind<ISessionFactory>().ToConstant(sessionFactory);
// Configure a resolver method to be used for creating ISession objects
container.Bind<ISession>().ToMethod(CreateSession);
container.Bind<ICurrentSessionContextAdapter>().To<CurrentSessionContextAdapter>();
}
and below when I am binding my ISession object to the HTTP context, I am getting error "Object reference not set"
public ISession CreateSession(IContext context)
{
var sessionFactory = context.Kernel.Get<ISessionFactory>();
if (!CurrentSessionContext.HasBind(sessionFactory))
{
// Open new ISession and bind it to the current session context
var session = sessionFactory.OpenSession();
CurrentSessionContext.Bind(session);
}
return sessionFactory.GetCurrentSession();
}
The error is at at line: CurrentSessionContext.HasBind(sessionFactory)
The error details are:
[NullReferenceException: Object reference not set to an instance of an object.]
lambda_method(Closure , Object ) +73
NHibernate.Context.ReflectiveHttpContext.get_HttpContextCurrentItems() +84
NHibernate.Context.WebSessionContext.GetMap() +52
NHibernate.Context.MapBasedSessionContext.get_Session() +70
NHibernate.Context.CurrentSessionContext.HasBind(ISessionFactory factory) +71
CTP.ApiNext.Web.Api.App_Start.NinjectConfigurator.CreateSession(IContext context) in C:\Projects\UNILEVER\WHITELABEL\_api-next\ctp-api-next\src\CTP.ApiNext.Web.Api\App_Start\NinjectConfigurator.cs:91
Ninject.Activation.Providers.CallbackProvider`1.CreateInstance(IContext context) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Providers\CallbackProvider.cs:45
Ninject.Activation.Provider`1.Create(IContext context) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Provider.cs:38
Ninject.Activation.Context.Resolve() in c:\Projects\Ninject\ninject\src\Ninject\Activation\Context.cs:157
Ninject.<>c__DisplayClass10.<Resolve>b__c(IBinding binding) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:386
System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +145
System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source) +4077101
Ninject.Planning.Targets.Target`1.GetValue(Type service, IContext parent) in c:\Projects\Ninject\ninject\src\Ninject\Planning\Targets\Target.cs:197
Ninject.Planning.Targets.Target`1.ResolveWithin(IContext parent) in c:\Projects\Ninject\ninject\src\Ninject\Planning\Targets\Target.cs:165
Ninject.Activation.Providers.StandardProvider.GetValue(IContext context, ITarget target) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Providers\StandardProvider.cs:114
Ninject.Activation.Providers.<>c__DisplayClass4.<Create>b__2(ITarget target) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Providers\StandardProvider.cs:96
System.Linq.WhereSelectArrayIterator`2.MoveNext() +66
System.Linq.Buffer`1..ctor(IEnumerable`1 source) +216
System.Linq.Enumerable.ToArray(IEnumerable`1 source) +77
Ninject.Activation.Providers.StandardProvider.Create(IContext context) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Providers\StandardProvider.cs:96
Ninject.Activation.Context.Resolve() in c:\Projects\Ninject\ninject\src\Ninject\Activation\Context.cs:157
Ninject.<>c__DisplayClass10.<Resolve>b__c(IBinding binding) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:386
System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +145
System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source) +4077101
Ninject.Planning.Targets.Target`1.GetValue(Type service, IContext parent) in c:\Projects\Ninject\ninject\src\Ninject\Planning\Targets\Target.cs:197
Ninject.Planning.Targets.Target`1.ResolveWithin(IContext parent) in c:\Projects\Ninject\ninject\src\Ninject\Planning\Targets\Target.cs:165
Ninject.Activation.Providers.StandardProvider.GetValue(IContext context, ITarget target) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Providers\StandardProvider.cs:114
Ninject.Activation.Providers.<>c__DisplayClass4.<Create>b__2(ITarget target) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Providers\StandardProvider.cs:96
System.Linq.WhereSelectArrayIterator`2.MoveNext() +66
System.Linq.Buffer`1..ctor(IEnumerable`1 source) +216
System.Linq.Enumerable.ToArray(IEnumerable`1 source) +77
Ninject.Activation.Providers.StandardProvider.Create(IContext context) in c:\Projects\Ninject\ninject\src\Ninject\Activation\Providers\StandardProvider.cs:96
Ninject.Activation.Context.Resolve() in c:\Projects\Ninject\ninject\src\Ninject\Activation\Context.cs:157
Ninject.<>c__DisplayClass10.<Resolve>b__c(IBinding binding) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:386
System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +145
System.Linq.<CastIterator>d__b1`1.MoveNext() +85
System.Linq.Enumerable.Single(IEnumerable`1 source) +191
Ninject.ResolutionExtensions.Get(IResolutionRoot root, IParameter[] parameters) in c:\Projects\Ninject\ninject\src\Ninject\Syntax\ResolutionExtensions.cs:37
CTP.ApiNext.Web.Api.App_Start.NinjectWebCommon.RegisterServices(IKernel kernel) in C:\Projects\UNILEVER\WHITELABEL\_api-next\ctp-api-next\src\CTP.ApiNext.Web.Api\App_Start\NinjectWebCommon.cs:61
CTP.ApiNext.Web.Api.App_Start.NinjectWebCommon.CreateKernel() in C:\Projects\UNILEVER\WHITELABEL\_api-next\ctp-api-next\src\CTP.ApiNext.Web.Api\App_Start\NinjectWebCommon.cs:48
Ninject.Web.Common.Bootstrapper.Initialize(Func`1 createKernelCallback) in c:\Projects\Ninject\Ninject.Web.Common\src\Ninject.Web.Common\Bootstrapper.cs:50
CTP.ApiNext.Web.Api.App_Start.NinjectWebCommon.Start() in C:\Projects\UNILEVER\WHITELABEL\_api-next\ctp-api-next\src\CTP.ApiNext.Web.Api\App_Start\NinjectWebCommon.cs:27
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +192
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +108
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
WebActivator.BaseActivationMethodAttribute.InvokeMethod() +236
WebActivator.ActivationManager.RunActivationMethods() +534
WebActivator.ActivationManager.RunPreStartMethods() +41
WebActivator.ActivationManager.Run() +64
[InvalidOperationException: The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +550
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +90
System.Web.Compilation.BuildManager.ExecutePreAppStart() +135
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516
[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873912
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +456
I read so many posts, but no avail.
I have a MessageHandler (invoked by ninject), which invokes ISession, when I comment it out, the problem goes away. Why?
GlobalConfiguration.Configuration.MessageHandlers.Add(kernel.Get());
Your Factory and Session interfaces are not bound correctly. You have to set the scope as part of the Binding (InSingletonScope for the Factory as you only ever need one of these, and InThreadScope for the Session). This is so Ninject knows when to inject an existing reference or create a new instance of each type.
Try modifying your configuration to the following:
public void ConfigureNHibernate(IKernel container)
{
var sessionFactory = FluentNHibernate
.Cfg.Fluently.Configure()
.Database(
MsSqlConfiguration.MsSql2008.ConnectionString(
c => c.FromConnectionStringWithKey("ApikeysDb")))
.CurrentSessionContext("web")
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<CTP.ApiNext.Data.SqlServer.SqlCommandFactory>());
// Bind the ISession Factory - Singleton as only ever need one of these
container.Bind<ISessionFactory>().ToMethod(x =>configuration.BuildSessionFactory()).InSingletonScope();
// Bind the ISession
container.Bind<ISession>().ToMethod(c => c.Kernel.Get<ISessionFactory>().OpenSession()).InThreadScope();
}
To test the above you can immediately try to instantiate a Factory:
var sessionFactory = Kernel.Get<ISessionFactory>();

Error in create a outlook object

When I in visual studio 2010 on a windows 7 x64 machine wants to
integrate with Outlook 2010 I'll get this error:
System.Runtime.InteropServices.COMException was unhandled by user code
Message=Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).
Source=mscorlib
ErrorCode=-2146959355
StackTrace:
at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)
at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType)
at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj)
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at SpatialExcelAddIn.MapBrowserUI.AddAttachment() in C:\Userdata\Projects2010\ExcelAddin\ExcelAddin-branch\UIandExcelLayer\MapBrowserUI.cs:line 105
at SpatialExcelAddIn.MapBrowserUI.emailToolStripMenuItem_Click(Object sender, EventArgs e) in C:\Userdata\Projects2010\ExcelAddin\ExcelAddin-branch\UIandExcelLayer\MapBrowserUI.cs:line 86
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.MenuStrip.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
InnerException:
I have added a reference to the Outlook version 14 component and are
using the code:
OL.Application app = new OL.Application(); <-- this cause
the error
It only happens when Outlook is running, if I stop Outlook application
and run the code again, i works just fine.
,please advice!

crystal report object reference not set to an instance of an object

I have crystal reports that keeps saying this error:
{"Object reference not set to an instance of an object."}
Stacktrace:
at CrystalDecisions.Windows.Forms.PageControl.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at CrystalDecisions.Windows.Forms.PageControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.Show()
at System.Windows.Window.ShowDialog()
at ADR.Forms.GALReport.GuardianAdLitemReport.btnPreviewReport() in C:\Users\user\Development\ProjectADR\ADR\Forms\CaseCoordinatorReports\GALReport\GuardianAdLitemReport.xaml.cs:line 527
at ADR.Forms.GALReport.GuardianAdLitemReport.Button_Click(Object sender, RoutedEventArgs e) in C:\Users\user\Development\ProjectADR\ADR\Forms\CaseCoordinatorReports\GALReport\GuardianAdLitemReport.xaml.cs:line 90
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at ADR.Program.Main() in C:\Users\user\Development\ProjectADR\ADR\Program.cs:line 57
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Sometimes it loads, most of the time it says that. It seems to say that alternately. Like if I rerun the report, it loads the report as what is expected then does not on the second run. What is wrong?
it stops in this code:
crview.ShowDialog();
To give you background, I am using dataset source the same with otehr reports. but other reports are not havign this kind of problem. Anyone who can tell me? thanks.
While this is an older thread, here is how I solved my issue.
I found that I had a text box with a formula that was beyond the bounds of the page. So it was causing a new page to be created with a NULL string. The formula was crashing and causing the following error:
System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
I was only seeing this once in a while because the returned value sometimes caused the TextObject to grow.
To solve this
I can fix the formula to handle NULLs, though it would still cause the extra blank page
Re-position the text box within the bounds of my page size and set CanGrow to False.
I opted for both because a user could unintentionally cause blank pages by selecting a smaller paper size from their printer.
Upgrading to Crystal Reports for Visual Studio re-distributable version 13_0_3 solved this issue for me.
http://scn.sap.com/docs/DOC-7824
Solved!
I had this problem for years!
I work with DataSet as reportSource. Finally, after trying every solution I could find on forums, I found the answer myself: the DataSet contained null values, so I just had to make the DataSet string fields DefaultValue: " " instead of DBNull... dead simple, yet effective.
Hope this helps.

Resources