-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Strange Error
PostPosted: Tue Nov 24, 2009 3:51 pm 
Newbie

Joined: Tue Nov 24, 2009 3:44 pm
Posts: 1
Has anyone seen this error before?

2009-11-24 10:20:43,220 ERROR NHibernate.ByteCode.Castle.ProxyFactory - Creating a proxy instance failed
System.Runtime.InteropServices.COMException (0x800703FA): Illegal operation attempted on a registry key that has been marked for deletion. (Exception from HRESULT: 0x800703FA)
at System.Reflection.Assembly._nDefineDynamicModule(Assembly containingAssembly, Boolean emitSymbolInfo, String filename, StackCrawlMark& stackMark)
at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternalNoLock(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark)
at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternal(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark)
at System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(String name, Boolean emitSymbolInfo)
at Castle.DynamicProxy.ModuleScope.CreateModule(Boolean signStrongName)
at Castle.DynamicProxy.ModuleScope.ObtainDynamicModuleWithWeakName()
at Castle.DynamicProxy.Generators.Emitters.ClassEmitter.CreateTypeBuilder(ModuleScope modulescope, String name, Type baseType, Type[] interfaces, TypeAttributes flags, Boolean forceUnsigned)
at Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope modulescope, String name, Type baseType, Type[] interfaces, TypeAttributes flags, Boolean forceUnsigned)
at Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope modulescope, String name, Type baseType, Type[] interfaces)
at Castle.DynamicProxy.Generators.BaseProxyGenerator.BuildClassEmitter(String typeName, Type parentType, Type[] interfaces)
at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] interfaces, ProxyGenerationOptions options)
at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors)
at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, IInterceptor[] interceptors)
at NHibernate.ByteCode.Castle.ProxyFactory.GetProxy(Object id, ISessionImplementor session)


I am using NHibernate 2.1, FluentNHibernate with an asp.net mvc application. I only see this error after an appsetting in the web.config has been changed. Before the config is changed I can execute the criteria fine. below is my entity structure and fluentNHibernate map


public class ProjectTotal : EntityBase
{
#region Properties

public virtual decimal Amount { get; set; }
public virtual int MonthNumber { get; set; }
public virtual Project Project { get; set; }
public virtual int ProjectTotalId { get; set; }
public virtual Scenario Scenario { get; set; }

#endregion
}


public class ProjectTotalMap : ClassMap<ProjectTotal>
{
#region Constructors

public ProjectTotalMap()
{
Schema("CapEx");

Id(x => x.ProjectTotalId).GeneratedBy.Identity();
References(x => x.Project).Column("ProjectId").Not.Nullable();
References(x => x.Scenario).Column("ScenarioId").Not.Nullable();
Map(x => x.MonthNumber).Not.Nullable();
Map(x => x.Amount).Not.Nullable();
}

#endregion
}

public class BaseProject : EntityBase, IAuditEntity
{
#region Properties

public virtual string Name { get; set; }
public virtual int? ProjectId { get; set; }

public virtual int GLAccountId { get; set; }
public virtual int GLSubAccountId { get; set; }
public virtual string PropId { get; set; }
public virtual int FiscalYear { get; set; }
public virtual DateTime? StartDate { get; set; }
public virtual string AppliesToUnits { get; set; }
public virtual int TotalMonths { get; set; }
public virtual decimal EstimatedAmount { get; set; }
public virtual string Location { get; set; }
public virtual string Description { get; set; }
public virtual string WorkReason { get; set; }
public virtual string Notes { get; set; }
public virtual string AssignedTo { get; set; }
public virtual bool IsBudgeted { get; set; }
#endregion

#region IAuditEntity Members

public virtual string CreatedBy { get; set; }

public virtual DateTime CreationDate { get; set; }

public virtual string ModifiedBy { get; set; }

public virtual DateTime ModifiedDate { get; set; }

#endregion
}

public class Project : BaseProject
{
}

public class ProjectMap : BaseProjectMap<Project>
{

}

public class BaseProjectMap<T> : ClassMap<T>
where T:BaseProject
{
#region Constructors

public BaseProjectMap()
{
Schema("CapEx");
Table("Project");
Id(x => x.ProjectId).GeneratedBy.Identity();
Map(x => x.Name).Not.Nullable().Length(200);

Map(x => x.IsBudgeted);

Map(x => x.AppliesToUnits).Length(200);
Map(x => x.AssignedTo).Length(50);
Map(x => x.Description).Length(8000);
Map(x => x.EstimatedAmount);
Map(x => x.FiscalYear);
Map(x => x.GLAccountId).Not.Nullable();
Map(x => x.GLSubAccountId).Not.Nullable();
Map(x => x.Location).Length(200);
Map(x => x.Notes).Length(8000);
Map(x => x.PropId).Length(3);
Map(x => x.StartDate);
Map(x => x.TotalMonths);
Map(x => x.WorkReason);

Map(x => x.CreatedBy).Not.Nullable();
Map(x => x.CreationDate).Not.Nullable();
Map(x => x.ModifiedBy).Not.Nullable();
Map(x => x.ModifiedDate).Not.Nullable();
}

#endregion
}

Here is the criteria I am trying to execute
ICriteria projectTotalCriteria = session.CreateCriteria(typeof(ProjectTotal));
projectTotalCriteria.CreateCriteria("Project")
.Add(Restrictions.And(Restrictions.Eq("FiscalYear", year), Restrictions.Eq("PropId", propId)));


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.