It needs to be in the CLASSPATH somewhere. I put mine in WEB-INF/classes and it seems 
to work
well.

Thanks,
Patrick

--- Yin Shi <[EMAIL PROTECTED]> wrote:
> Hi, I am using WSAD5 and Hibernate2, I do not know where to put the .cfg.xml file,
> because I tried to put it in every directory, they are not working at all. Do you 
> know
> where to put it? 
> 
> I just have a Web Project, inside the Java Source, I have a java class Cat.java
> (setter/getter), and a servlet to get the Hibernate session, when I call 
> " 
> Configuration conf = new
> Configuration().configure().addClass(net.sf.hibernate.examples.quickstart.Cat.class);
>  
> ", 
> 
> it always gives me an error message saying that " 
> 3100cb4a Configuration I net.sf.hibernate.cfg.Configuration Configuration resource:
> /hibernate.cfg.xml 
> 3100cb4a Configuration W net.sf.hibernate.cfg.Configuration /hibernate.cfg.xml not
> found 
> 3100cb4a WebGroup E SRVE0026E: [Servlet Error]-[/hibernate.cfg.xml not found]:
> net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found 
> at
> net.sf.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:708)
>  
> " 
> 
> This is my cfg.xml 
> ------------------------------------------------------------------------------ 
> 
> <?xml version='1.0' encoding='utf-8'?> 
> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration 
> DTD//EN"
> 
>                                          "C:\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> 
> 
> -------------------------------------------------------------------------------- 
> 
> So could anyone help me? 
> 
> Thanks a lot!
> 
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
> _______________________________________________
> hibernate-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/hibernate-devel


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to