zzeng

zzeng

hibernate.cfg.xml not found

hibernate.cfg.xml not found - WebSphere PortalServer

Posted by: Bernd Zimmermann on November 23, 2004 in response to Message #92850 0 replies in this thread
We had the 'hibernate.cfg.xml not found' problem when developing
IBM WebSphere Portalserver portlets with struts and hibernate.

The solution was to have the hibernate.cfg.xml in WebSphere
Application Developer in ./JavaSources and get the hibernate
configuration at runtime this way:

File f=new File(servlet.getServletContext()
.getRealPath("/WEB-INF/classes/hibernate.cfg.xml"));

Configuration c = new Configuration().configure(f);

This is portable from WSAD to WPS

posted on 2005-09-28 13:42 zzeng 阅读(1707) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: