一个nested exception问题

一个hibernate报的异常:nested exception is org.hibernate.QueryException: could not resolve property困扰了我好一阵。

原来是因为hibernate对象不能多层嵌套查询,比如:
dc.add(Restrictions.eq(“wdxcAddressbookClass.wdxcUser.id”,ownerId));
改为:
dc.add(Restrictions.sqlRestriction(“{alias}.classid in (select id from wdxc_addressbook_class where ownerid=?)”,ownerId,Hibernate.LONG));
之后就可以了

顺便把前几天遇到的一个问题也记录一下:

环境是jsf+spring+hibernate,由于页面还没设计好,后台业务处理部分已经写好了,想测试一下,就做了一个测试jsp页面
异常信息:could not initialize proxy – the owning Session was closed
解决方法一:
[java]
public WdxcAddressbook getAddressbookByID(Serializable id) {
WdxcAddressbook addressbook =(WdxcAddressbook)dao.load(WdxcAddressbook.class,id);
//System.out.println(addressbook.getId());
return addressbook;
}
[/java]
在spring接口实现类中获取一下对象,就是上面注释掉的
解决方面二:
在web.xml中把.jsp页面也添加到hibernate的filter-mapping
原因:原来jsf的hibernate filter处理的都是.faces的页面,没有处理.jsp的页面,而且hibernate数据库实际获取操作是在用户实际获取值的时候发生的,所以需要filter把session延迟到jsp页面中

2,261人评论了“一个nested exception问题”

  1. I needed to compose you one very small word to help thank you very much as before just for the precious things you have discussed in this case. It was really unbelievably open-handed of you to make without restraint all that some people might have sold as an ebook to help with making some dough on their own, precisely given that you could possibly have done it if you ever wanted. These ideas in addition served as a easy way to be aware that other individuals have similar keenness much like mine to find out very much more concerning this matter. I’m sure there are lots of more enjoyable situations up front for folks who start reading your site.

  2. I have to show appreciation to you for bailing me out of such a difficulty. As a result of looking throughout the world wide web and getting thoughts which are not productive, I figured my entire life was gone. Living devoid of the answers to the problems you’ve sorted out through the website is a crucial case, and the ones which may have negatively affected my career if I had not noticed the blog. Your good mastery and kindness in taking care of almost everything was precious. I don’t know what I would have done if I hadn’t encountered such a point like this. I am able to at this time relish my future. Thanks very much for this impressive and amazing help. I will not hesitate to recommend the blog to anyone who needs and wants tips about this problem.

  3. I’m just commenting to let you understand what a amazing experience my friend’s daughter had going through your web page. She discovered so many details, most notably how it is like to possess an awesome coaching character to make other individuals completely know a variety of tortuous topics. You truly surpassed our own expectations. Many thanks for showing the beneficial, healthy, revealing and even fun guidance on your topic to Ethel.

  4. My husband and i felt so glad when John could finish off his investigations through the precious recommendations he grabbed when using the site. It’s not at all simplistic to simply be handing out guidance other people might have been making money from. And we all realize we’ve got the blog owner to appreciate for this. The type of illustrations you made, the easy web site menu, the relationships you can give support to create – it is everything extraordinary, and it’s assisting our son and us consider that the issue is awesome, which is certainly rather indispensable. Many thanks for all the pieces!

  5. you are really a just right webmaster. The site loading velocity is incredible.
    It kind of feels that you are doing any unique trick.
    Moreover, The contents are masterpiece. you’ve done a great task in this topic!

  6. I needed to post you a little bit of remark to help say thanks as before considering the marvelous information you have documented on this website. This has been certainly pretty open-handed with people like you to grant unhampered what a few individuals could possibly have marketed as an ebook to help with making some cash on their own, even more so seeing that you might have tried it in case you desired. Those tricks additionally served to be a great way to be aware that other people have the identical passion just like mine to know very much more when considering this matter. I’m certain there are many more fun sessions up front for individuals who read through your website.

  7. I wish to show thanks to this writer just for rescuing me from this scenario. Right after researching through the the web and obtaining thoughts that were not pleasant, I assumed my entire life was well over. Living without the presence of solutions to the problems you have resolved through your entire article is a critical case, as well as the ones which may have negatively damaged my entire career if I hadn’t come across the blog. The mastery and kindness in taking care of everything was excellent. I don’t know what I would have done if I had not encountered such a subject like this. I can at this time relish my future. Thanks for your time so much for this skilled and result oriented help. I will not think twice to refer the website to anybody who would need guidance on this area.

  8. I precisely desired to say thanks once again. I do not know what I might have achieved without the type of advice shared by you about such question. Completely was a very horrifying condition in my circumstances, nevertheless encountering a new specialised avenue you handled that forced me to weep with delight. I’m just thankful for this assistance and thus hope you really know what a powerful job that you’re undertaking training the rest through the use of your site. Probably you have never met all of us.

  9. Needed to compose you this very small observation so as to thank you very much over again about the spectacular pointers you have discussed above. This has been so incredibly open-handed of you giving without restraint what exactly many people could possibly have supplied for an e-book to help make some profit for their own end, precisely since you could possibly have done it in case you desired. The principles additionally acted like a great way to comprehend other people have the same interest like mine to know a little more with regard to this condition. I know there are many more pleasurable times in the future for those who view your blog post.

  10. Thanks a lot for providing individuals with remarkably memorable opportunity to read from this web site. It’s always very great and packed with a great time for me personally and my office mates to search your web site the equivalent of three times a week to study the fresh things you have. And of course, I am also actually amazed with your fantastic advice you give. Selected 2 points in this article are unquestionably the finest we have all ever had.

  11. Thanks a lot for giving everyone such a pleasant opportunity to read from here. It really is so awesome and also jam-packed with a great time for me personally and my office acquaintances to visit your website the equivalent of 3 times in a week to read through the latest secrets you have got. And definitely, we’re always amazed considering the sensational concepts served by you. Certain 2 areas in this article are ultimately the most beneficial I’ve had.

  12. I wish to get across my love for your kind-heartedness in support of folks that need assistance with this one idea. Your real dedication to getting the solution around turned out to be incredibly informative and have continually encouraged most people just like me to realize their desired goals. This valuable information means this much to me and somewhat more to my peers. Thanks a ton; from everyone of us.

  13. I’m just commenting to let you understand what a great encounter my cousin’s girl obtained going through your blog. She noticed some issues, with the inclusion of what it’s like to have a wonderful coaching mood to have folks easily master a variety of complicated subject matter. You actually did more than our desires. Thank you for producing such valuable, dependable, edifying and cool tips on the topic to Kate.

  14. I in addition to my buddies were actually going through the great solutions found on your website and before long got a horrible suspicion I never expressed respect to you for those strategies. My women were definitely so passionate to read them and now have in reality been having fun with those things. Thank you for really being considerably helpful and then for having this sort of ideal information millions of individuals are really desperate to know about. My very own sincere regret for not saying thanks to sooner.

  15. Thanks a lot for providing individuals with remarkably remarkable possiblity to read critical reviews from here. It can be very brilliant and packed with a great time for me personally and my office co-workers to search your site at the least three times in 7 days to find out the newest stuff you have. Of course, we’re always contented with all the staggering opinions you give. Certain 2 ideas in this posting are indeed the most effective we have all ever had.

  16. My wife and i were quite comfortable when Emmanuel could do his homework through the entire precious recommendations he obtained while using the web pages. It is now and again perplexing to simply be freely giving secrets which often many others could have been trying to sell. So we grasp we have got the blog owner to thank for that. The specific explanations you have made, the easy blog navigation, the friendships you will give support to engender – it’s got most remarkable, and it’s really aiding our son in addition to us do think the situation is entertaining, and that’s incredibly important. Thanks for everything!

  17. I would like to express my thanks to you for rescuing me from this particular scenario. Just after surfing throughout the the net and coming across basics that were not pleasant, I figured my life was done. Existing minus the answers to the difficulties you have sorted out all through your entire short article is a serious case, and the kind that might have in a negative way damaged my career if I hadn’t noticed your blog. Your own personal natural talent and kindness in dealing with the whole lot was helpful. I’m not sure what I would have done if I had not encountered such a point like this. It’s possible to at this point look ahead to my future. Thanks a lot very much for your professional and sensible help. I will not be reluctant to endorse your blog to anybody who should receive guidance on this subject matter.

  18. I would like to convey my admiration for your generosity for men and women that should have guidance on in this theme. Your special dedication to passing the solution all around had become remarkably good and have constantly helped ladies just like me to arrive at their endeavors. Your amazing valuable recommendations denotes this much to me and still more to my office workers. With thanks; from all of us.

  19. I am also commenting to make you know what a wonderful experience my wife’s daughter experienced going through your webblog. She came to understand lots of details, most notably how it is like to possess a very effective teaching spirit to have many others really easily thoroughly grasp specified hard to do things. You truly exceeded people’s expectations. Many thanks for delivering those essential, safe, informative and even cool tips about the topic to Tanya.

  20. Thanks so much for giving everyone a very remarkable chance to read critical reviews from this site. It can be very terrific and as well , jam-packed with fun for me personally and my office colleagues to visit the blog a minimum of three times a week to find out the fresh tips you have got. Of course, I am also certainly fulfilled considering the very good points you give. Some 4 areas in this post are particularly the most impressive we have had.

  21. My spouse and i got now satisfied when Ervin managed to deal with his survey from the precious recommendations he made when using the web page. It is now and again perplexing to simply choose to be freely giving facts that other people could have been selling. And now we recognize we’ve got the blog owner to give thanks to for that. The most important illustrations you made, the straightforward web site menu, the friendships you can make it possible to engender – it is all great, and it is leading our son and the family imagine that this article is cool, which is incredibly serious. Thanks for all the pieces!

  22. My wife and i ended up being quite thankful Ervin could carry out his homework through your ideas he came across using your site. It is now and again perplexing to simply find yourself releasing methods which often the rest might have been selling. So we see we have the website owner to thank because of that. All of the explanations you have made, the straightforward web site menu, the relationships your site assist to foster – it is all astonishing, and it’s facilitating our son in addition to us understand this situation is thrilling, and that is seriously fundamental. Thank you for everything!

  23. I wanted to write you that little bit of note so as to say thanks a lot again about the nice strategies you have shown on this page. It was really open-handed of people like you to make extensively just what most people could have distributed for an ebook in making some money for their own end, especially now that you could have tried it in case you decided. Those points additionally acted like the good way to fully grasp most people have similar eagerness just like my very own to realize a lot more in respect of this condition. I am certain there are thousands of more pleasurable periods in the future for folks who browse through your blog post.

  24. Thank you a lot for giving everyone such a special chance to read from this website. It’s usually so beneficial and as well , packed with a good time for me and my office fellow workers to search the blog minimum three times per week to see the fresh issues you have got. And of course, I’m so always fascinated with the gorgeous methods you serve. Selected 2 facts in this post are undoubtedly the most effective we have all had.

  25. Thank you a lot for giving everyone remarkably breathtaking chance to read from here. It is always so good and also packed with fun for me personally and my office acquaintances to visit your blog at least 3 times in 7 days to find out the fresh tips you have. And definitely, I’m so certainly fulfilled considering the fabulous principles you serve. Selected two areas in this post are unquestionably the very best we’ve had.

  26. That is the correct blog for anybody who desires to search out out about this topic. You realize so much its almost exhausting to argue with you (not that I actually would need匟aHa). You undoubtedly put a brand new spin on a topic thats been written about for years. Nice stuff, simply great!

  27. An attention-grabbing discussion is value comment. I believe that it’s best to write more on this topic, it may not be a taboo topic but generally persons are not sufficient to speak on such topics. To the next. Cheers

  28. This is the right blog for anyone who needs to seek out out about this topic. You realize so much its virtually exhausting to argue with you (not that I truly would want匟aHa). You positively put a new spin on a subject thats been written about for years. Great stuff, simply great!

  29. There are some fascinating cut-off dates on this article however I don抰 know if I see all of them middle to heart. There may be some validity but I will take hold opinion till I look into it further. Good article , thanks and we would like extra! Added to FeedBurner as effectively

  30. There are some fascinating deadlines on this article but I don抰 know if I see all of them middle to heart. There may be some validity but I will take maintain opinion till I look into it further. Good article , thanks and we wish more! Added to FeedBurner as nicely

发表评论

电子邮件地址不会被公开。 必填项已用*标注