-->
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.  [ 4 posts ] 
Author Message
 Post subject: 1.0.2 to 1.2.0.1 Alpha methodInfo Value cannot be null error
PostPosted: Fri Jun 09, 2006 12:51 am 
Beginner
Beginner

Joined: Mon Aug 15, 2005 11:50 pm
Posts: 22
I am going through attempting to update my code from NHibernate 1.0.2 to the 1.2.0.1 Alpha.

I've hit a snag and am unsure where exactly to look for the solution.

The code ran fine under 1.0.2 and now I get the following error.

Value cannot be null.
Parameter name: methodInfo

Code:
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.ArgumentNullException: Value cannot be null.
Parameter name: methodInfo

Source Error:

Code:

Line 49:       /// </summary>
Line 50:       //private static readonly ISessionFactory sessionFactory = configuration.Configure( HttpContext.Current.Request.MapPath(ConfigurationSettings.AppSettings["nhibernate.config"]) ).BuildSessionFactory();
Line 51:       private static readonly ISessionFactory sessionFactory = configuration.Configure(HttpContext.Current.Request.MapPath( ConfigurationManager.AppSettings["nhibernate.config"])).BuildSessionFactory();
Line 52:
Line 53:       /// <summary>


Source File: D:\Inetpub\ORPUDev\NHibernate.Helper\nHibernate.Helper.cs    Line: 51

Stack Trace:
Code:

[ArgumentNullException: Value cannot be null.
Parameter name: methodInfo]
   System.Reflection.Emit.DynamicILGenerator.EmitCall(OpCode opcode, MethodInfo methodInfo, Type[] optionalParameterTypes) +1608619
   NHibernate.Property.BasicSetter.Emit(ILGenerator il) in c:\net\nhibernate\nhibernate\src\NHibernate\Property\BasicSetter.cs:94
   NHibernate.Bytecode.Lightweight.ReflectionOptimizer.GenerateSetPropertyValuesMethod(IGetter[] getters, ISetter[] setters) in c:\net\nhibernate\nhibernate\src\NHibernate\Bytecode\Lightweight\ReflectionOptimizer.cs:212
   NHibernate.Bytecode.Lightweight.ReflectionOptimizer..ctor(Type mappedType, IGetter[] getters, ISetter[] setters) in c:\net\nhibernate\nhibernate\src\NHibernate\Bytecode\Lightweight\ReflectionOptimizer.cs:47
   NHibernate.Bytecode.Lightweight.BytecodeProviderImpl.GetReflectionOptimizer(Type mappedClass, IGetter[] getters, ISetter[] setters) in c:\net\nhibernate\nhibernate\src\NHibernate\Bytecode\Lightweight\BytecodeProviderImpl.cs:40
   NHibernate.Persister.Entity.AbstractEntityPersister..ctor(PersistentClass persistentClass, ISessionFactoryImplementor factory) in c:\net\nhibernate\nhibernate\src\NHibernate\Persister\Entity\AbstractEntityPersister.cs:820
   NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(PersistentClass model, ISessionFactoryImplementor factory, IMapping mapping) in c:\net\nhibernate\nhibernate\src\NHibernate\Persister\Entity\SingleTableEntityPersister.cs:771
   NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ISessionFactoryImplementor factory, IMapping cfg) in c:\net\nhibernate\nhibernate\src\NHibernate\Persister\PersisterFactory.cs:51
   NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings) in c:\net\nhibernate\nhibernate\src\NHibernate\Impl\SessionFactoryImpl.cs:169
   NHibernate.Cfg.Configuration.BuildSessionFactory() in c:\net\nhibernate\nhibernate\src\NHibernate\Cfg\Configuration.cs:1007
   NHibernate.Helper.Db..cctor() in D:\Inetpub\ORPUDev\NHibernate.Helper\nHibernate.Helper.cs:51

[TypeInitializationException: The type initializer for 'NHibernate.Helper.Db' threw an exception.]
   NHibernate.Helper.Db.CloseSession() in D:\Inetpub\ORPUDev\NHibernate.Helper\nHibernate.Helper.cs:122
   NHibernate.Helper.Module.EndRequest(Object sender, EventArgs e) in D:\Inetpub\ORPUDev\NHibernate.Helper\HttpModules\NHibernateSessionModule.cs:20
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64





Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 09, 2006 8:41 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
This is bug NH-642.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 15, 2006 10:38 pm 
Regular
Regular

Joined: Tue Sep 02, 2003 5:09 pm
Posts: 81
Location: Whitefish Montana
I have a similar error when trying out 1.2.0.Alpha1. Before I spend too much time on this, do you think they are related?

Thanks,

David Morris

System.ArgumentNullException was unhandled
Message="Value cannot be null.\r\nParameter name: methodInfo"
Source="mscorlib"
ParamName="methodInfo"
StackTrace:
at System.Reflection.Emit.DynamicILGenerator.EmitCall(OpCode opcode, MethodInfo methodInfo, Type[] optionalParameterTypes)
at NHibernate.Property.BasicSetter.Emit(ILGenerator il) in c:\net\nhibernate\nhibernate\src\NHibernate\Property\BasicSetter.cs:line 94
at NHibernate.Bytecode.Lightweight.ReflectionOptimizer.GenerateSetPropertyValuesMethod(IGetter[] getters, ISetter[] setters) in c:\net\nhibernate\nhibernate\src\NHibernate\Bytecode\Lightweight\ReflectionOptimizer.cs:line 212
at NHibernate.Bytecode.Lightweight.ReflectionOptimizer..ctor(Type mappedType, IGetter[] getters, ISetter[] setters) in c:\net\nhibernate\nhibernate\src\NHibernate\Bytecode\Lightweight\ReflectionOptimizer.cs:line 47
at NHibernate.Bytecode.Lightweight.BytecodeProviderImpl.GetReflectionOptimizer(Type mappedClass, IGetter[] getters, ISetter[] setters) in c:\net\nhibernate\nhibernate\src\NHibernate\Bytecode\Lightweight\BytecodeProviderImpl.cs:line 40
at NHibernate.Persister.Entity.AbstractEntityPersister..ctor(PersistentClass persistentClass, ISessionFactoryImplementor factory) in c:\net\nhibernate\nhibernate\src\NHibernate\Persister\Entity\AbstractEntityPersister.cs:line 820
at NHibernate.Persister.Entity.SingleTableEntityPersister..ctor(PersistentClass model, ISessionFactoryImplementor factory, IMapping mapping) in c:\net\nhibernate\nhibernate\src\NHibernate\Persister\Entity\SingleTableEntityPersister.cs:line 771
at NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ISessionFactoryImplementor factory, IMapping cfg) in c:\net\nhibernate\nhibernate\src\NHibernate\Persister\PersisterFactory.cs:line 51
at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings) in c:\net\nhibernate\nhibernate\src\NHibernate\Impl\SessionFactoryImpl.cs:line 169
at NHibernate.Cfg.Configuration.BuildSessionFactory() in c:\net\nhibernate\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1007
at HomeAssurance.Tests.ContactTest.Insert() in D:\projects\HomeAssurance\console\ContactTest.cs:line 28
at HomeAssurance.Tests.ContactTest.Main(String[] args) in D:\projects\HomeAssurance\console\ContactTest.cs:line 18
at System.AppDomain.nExecuteAssembly(Assembly 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)
at System.Threading.ThreadHelper.ThreadStart()


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 15, 2006 11:01 pm 
Regular
Regular

Joined: Tue Sep 02, 2003 5:09 pm
Posts: 81
Location: Whitefish Montana
I should have done some more research. Although the error I recieved is misleading, my mapping file did not have an access property. I found this by running up the stack trace to the AbstractEntityPersiser, which showed the class, setters and getter. Adding access="nosetter.camelcase" to my map seems to avoid this error.

Thanks,

David Morris


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

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.