开发者

Problem with spring + nhibernate in .net environment

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜