JiveJdon Community Forums
在线105人   首页   主题表   培训咨询   标签   精华   查搜   注册    登陆 RSS
首页 » 论坛 » J2EE/JavaEE/JEE/EJB/JSF等技术讨论
???en_US.forumThreadPrev.name??? 上一主题
google yahoo 365Key网摘 CSDN网摘 添加到百度搜藏 POCO网摘 新浪ViVi 天极网摘
???en_US.forumThreadNext.name??? 下一主题
Go 共有 2 回复 / 1
 发表新帖子   回复该主题贴
xinxin2

悄悄话
发表文章: 11
注册时间: 2003年08月19日 21:06
WSAD5 with Hibernate 2003年08月19日 21:19 到本帖网址 加入本帖到收藏夹 回复该主题
标签
有]有人在WSAD5中用^Hibernate阿t
我了好Lrgo有e`o不知道l能我。


I just have a Web Project, and inside the Java Source, I have a java class Cat.java (setter/getter), and a servlet (calling Hibernate Configure to get session), I have tried to put Hibernate.cfg.xml file to each directory(WEB-INF/classes, WEB-INF, Java Source, ...), but all do not work at all, I don't know why, do you know where the .cfg.xml need to be put? Or do I need to have the .cfg.xml file path in web.xml? I have no idea.

Do you have an example about creating a web application using WSAD5 and Hibernate?

Thanks so much for helps.

The error message is:
_______________________________________________________

" I net.sf.hibernate.cfg.Configuration Configuration resource: /hibernate.cfg.xml
7bff0b53 Configuration W net.sf.hibernate.cfg.Configuration /hibernate.cfg.xml not found
7bff0b53 WebGroup E SRVE0026E: [Servlet Error]-[/hibernate.cfg.xml not found]: net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found
"
_______________________________________________________

hibernate.cfg.xml
_______________________________________________________

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE Hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"> />
<hibernate-configuration>

<session-factory>

<property name="hibernate.connection.driver_class">COM.ibm.db2.jdbc.net.DB2Driver</property>
<property name="hibernate.connection.url">jdbc:db2:JDO</property>
<property name="hibernate.connection.username">admin</property>
<property name="hibernate.connection.password">admin</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="dialect">net.sf.hibernate.dialect.DB2Dialect</property>

<!-- Mapping files -->
<mapping resource="Cat.hbm.xml"/>
</session-factory>

</hibernate-configuration>
______________________________________________________
yehs220

悄悄话
发表文章: 101
注册时间: 2003年01月04日 12:50
Re: WSAD5 with Hibernate 2003年08月20日 13:19 到本帖网址 加入本帖到收藏夹 回复该主题
我知道Hibernate.properties是放在classpath的根下面,
我想Hibernate.cfg.xml也是吧。

xinxin2

悄悄话
发表文章: 11
注册时间: 2003年08月19日 21:06
Re: WSAD5 with Hibernate 2003年08月20日 21:00 到本帖网址 加入本帖到收藏夹 回复该主题
Thank you yehs220 for helping!

I will try to put .cfg.xml to the classpath root. Thanks
标签
共有 2 回复 / 1Go
???en_US.forumThreadPrev.name??? 上一主题
  Go back to the topic 返回本主题   Go back to the topic listing返回主题列表    返回页首返回页首
???en_US.forumThreadNext.name??? 下一主题
热点TAG:
正在读取,请等待...
查询本论坛内 回复超过的热门帖子
标题
 
粗体: [b]文本[/b] 斜体: [i]文本[/i] 下划线 [u]文本[/u] 插入图片 [img]http://wwww.xxxx.com/img.ext[/img] 插入代码 [code]程序代码[/code]  插入url链接 [url]http://url[/url] / [url=http://url]URL加下滑线[/url] 插入附件 插入word文档 Txt等文件
内容
  提交时自动拷贝以上内容到剪贴板 Ctrl-V可取出;提问题前先查询标签列表

RSS 手机阅读 add to google add to yahoo
解惑之道在J道 ,打造中国最具影响力的的企业软件社区 推荐Chrome快速浏览本站
OpenSource JIVEJDON v3.5 Powered by JdonFramework Code © 2002-09 jdon.com

anti spam