Hi,
A web site we recently deployed is being pulled down by reaching high levels of CPU, we are logging to the event log and the recurring exceptions I see are:
Duplicate type name within an assembly
and
Failed to lazily initialize a collection ---> NHibernate.HibernateException: Creating a proxy instance failed ---> System.ArgumentException: Duplicate type name within an assembly.
We really need some help with these bugs as the client is far from happy.
I would greatly appreciate any assistance.
We were running NHibernate 1.0.2.0 but we upgraded to 1.0.3.0 but we are still getting the same exceptions. I have copied across the NHibernate .dlls and the CastleProxy.dll from the 1.0.3.0 release. I have pasted the 2 stack traces in the order they are above:
1.Duplicate type name within an assembly
System.ArgumentException: Duplicate type name within an assembly.
at System.Reflection.Emit.AssemblyBuilderData.CheckTypeNameConflict(String strTypeName, TypeBuilder enclosingType)
at System.Reflection.Emit.TypeBuilder.Init(String fullname, TypeAttributes attr, Type parent, Type[] interfaces, Module module, PackingSize iPackingSize, Int32 iTypeSize, TypeBuilder enclosingType)
at System.Reflection.Emit.ModuleBuilder.DefineTypeNoLock(String name, TypeAttributes attr, Type parent, Type[] interfaces)
at System.Reflection.Emit.ModuleBuilder.DefineType(String name, TypeAttributes attr, Type parent, Type[] interfaces)
at Castle.DynamicProxy.Builder.CodeBuilder.EasyType..ctor(ModuleScope modulescope, String name, Type baseType, Type[] interfaces, Boolean serializable)
at Castle.DynamicProxy.Builder.CodeGenerators.BaseCodeGenerator.CreateTypeBuilder(String typeName, Type baseType, Type[] interfaces)
at Castle.DynamicProxy.Builder.CodeGenerators.ClassProxyGenerator.GenerateCode(Type baseClass, Type[] interfaces)
at Castle.DynamicProxy.Builder.DefaultProxyBuilder.CreateClassProxy(Type theClass, Type[] interfaces)
at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type baseClass, Type[] interfaces, IInterceptor interceptor, Boolean checkAbstract, Object[] argumentsForConstructor)
at NHibernate.Proxy.CastleProxyFactory.GetProxy(Object id, ISessionImplementor session)
2. Failed to lazily initialize a collection
Failed to lazily initialize a collection
NHibernate.LazyInitializationException: Failed to lazily initialize a collection ---> NHibernate.HibernateException: Creating a proxy instance failed ---> System.ArgumentException: Duplicate type name within an assembly.
at System.Reflection.Emit.AssemblyBuilderData.CheckTypeNameConflict(String strTypeName, TypeBuilder enclosingType)
at System.Reflection.Emit.TypeBuilder.Init(String fullname, TypeAttributes attr, Type parent, Type[] interfaces, Module module, PackingSize iPackingSize, Int32 iTypeSize, TypeBuilder enclosingType)
at System.Reflection.Emit.ModuleBuilder.DefineTypeNoLock(String name, TypeAttributes attr, Type parent, Type[] interfaces)
at System.Reflection.Emit.ModuleBuilder.DefineType(String name, TypeAttributes attr, Type parent, Type[] interfaces)
at Castle.DynamicProxy.Builder.CodeBuilder.EasyType..ctor(ModuleScope modulescope, String name, Type baseType, Type[] interfaces, Boolean serializable)
at Castle.DynamicProxy.Builder.CodeGenerators.BaseCodeGenerator.CreateTypeBuilder(String typeName, Type baseType, Type[] interfaces)
at Castle.DynamicProxy.Builder.CodeGenerators.ClassProxyGenerator.GenerateCode(Type baseClass, Type[] interfaces)
at Castle.DynamicProxy.Builder.DefaultProxyBuilder.CreateClassProxy(Type theClass, Type[] interfaces)
at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type baseClass, Type[] interfaces, IInterceptor interceptor, Boolean checkAbstract, Object[] argumentsForConstructor)
at NHibernate.Proxy.CastleProxyFactory.GetProxy(Object id, ISessionImplementor session)
--- End of inner exception stack trace ---
at NHibernate.Proxy.CastleProxyFactory.GetProxy(Object id, ISessionImplementor session)
at NHibernate.Persister.AbstractEntityPersister.CreateProxy(Object id, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.DoLoadByClass(Type clazz, Object id, Boolean checkDeleted, Boolean allowProxyCreation)
at NHibernate.Impl.SessionImpl.InternalLoad(Type clazz, Object id)
at NHibernate.Type.ManyToOneType.ResolveIdentifier(Object id, ISessionImplementor session)
at NHibernate.Type.EntityType.ResolveIdentifier(Object id, ISessionImplementor session, Object owner)
at NHibernate.Type.EntityType.NullSafeGet(IDataReader rs, String[] names, ISessionImplementor session, Object owner)
at NHibernate.Collection.AbstractCollectionPersister.ReadElement(IDataReader rs, Object owner, ISessionImplementor session)
at NHibernate.Collection.Map.ReadFrom(IDataReader rs, ICollectionPersister persister, Object owner)
at NHibernate.Loader.Loader.ReadCollectionElement(Object optionalOwner, Object optionalKey, IDataReader rs, ISessionImplementor session)
at NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader resultSet, ISessionImplementor session, QueryParameters queryParameters, IList hydratedObjects, Object optionalObject, Object optionalId, Key[] keys, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
at NHibernate.Loader.CollectionLoader.Initialize(Object id, ISessionImplementor session)
at NHibernate.Collection.AbstractCollectionPersister.Initialize(Object key, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.InitializeCollection(PersistentCollection collection, Boolean writing)
at NHibernate.Collection.PersistentCollection.Initialize(Boolean writing)
--- End of inner exception stack trace ---
|