开发者

Problem with spring + nhibernate in .net environment

开发者 https://www.devze.com 2022-12-22 13:57 出处:网络
I am working with Spring.net 1.3 and nHibernate for .net 1.3. While fetching the ap开发者_高级运维plication context using XML ( _appContext = new XmlApplicationContext(\"abc.xml\")) I am getting the e

I am working with Spring.net 1.3 and nHibernate for .net 1.3. While fetching the ap开发者_高级运维plication context using XML ( _appContext = new XmlApplicationContext("abc.xml")) I am getting the exception as "Error creating object with name 'NHibernateSessionFactory' defined in abc.xml" Initialization of object failed : The following types may not be used as proxies"

I have declared all the properties of class as public virtual.still why am i getting this exception

Thanks in advance


You must have missed marking a property or method virtual. The exception (or an InnerException, I'm not familiar with Spring) message should tell you exactly which type is the problem. For example, I just reproduced this:

{"The following types may not be used as proxies:\nModel.Project: method get_ProjectId should be 'public/protected virtual' or 'protected internal virtual'"}
0

精彩评论

暂无评论...
验证码 换一张
取 消