Likely yours. I just set up a fresh Hibernate install on Tomcat 5.5 (with Log4j)
with no problems. Define what you mean by "didn't work".
> "Rico" <ras_nas@yahoo.com> wrote in message
>> "The XML configuration file is placed in the context classpath
>> (WEB-INF/classes), as hibernate.cfg.xml"
>> For Hibernate, I placed the xml file in several folders after some
>> googling:
[quoted text clipped - 11 lines]
> Likely yours. I just set up a fresh Hibernate install on Tomcat 5.5
> (with Log4j) with no problems. Define what you mean by "didn't work".
As I said, for Hibernate under Tomcat (4.1.18 and 4.1.31), no matter where
I put the hibernate.cfg.xml, including WEB-INF/classes, I got the message
that the file is not to be found when we reach the following code:
sessionFactory = new Configuration().configure()
.buildSessionFactory();
2005-02-18 15:28:00,968 WARN http-8080-Processor4
net.sf.hibernate.cfg.Configuration - /hibernate.cfg.xml not found
I've considered trying Tomcat 5.0.x but it seems that first I need to
figure out which ones and adapt a couple of settings in server.xml and/or
web.xml to get it to stop crashing.
Rico.
Ryan Stewart - 18 Feb 2005 12:53 GMT
> As I said, for Hibernate under Tomcat (4.1.18 and 4.1.31), no matter where
> I put the hibernate.cfg.xml, including WEB-INF/classes, I got the message
[quoted text clipped - 9 lines]
> figure out which ones and adapt a couple of settings in server.xml and/or
> web.xml to get it to stop crashing.
What version of Hibernate are you using? When I remove the config file, I get
this in the log: (line breaks inserted to prevent wrap and logging set to INFO
level)
INFO [http-8080-Processor25] cfg.Environment (<clinit>:483)
- Hibernate 2.1.8
INFO [http-8080-Processor25] cfg.Environment (<clinit>:512)
- hibernate.properties not found
INFO [http-8080-Processor25] cfg.Environment (<clinit>:543)
- using CGLIB reflection optimizer
INFO [http-8080-Processor25] cfg.Environment (<clinit>:572)
- using JDK 1.4 java.sql.Timestamp handling
INFO [http-8080-Processor25] cfg.Configuration (configure:909)
- configuring from resource: /hibernate.cfg.xml
INFO [http-8080-Processor25] cfg.Configuration
(getConfigurationInputStream:881)
- Configuration resource: /hibernate.cfg.xml
WARN [http-8080-Processor25] cfg.Configuration
(getConfigurationInputStream:885)
- /hibernate.cfg.xml not found
ERROR [http-8080-Processor25] persistence.HibernateUtil (<clinit>:19)
- Initial SessionFactory creation failed.
net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found
Does that look like what you're getting? I assume you're using some build tool.
Are you sure that the config file is being built to the right place?
Rico - 18 Feb 2005 16:02 GMT
> What version of Hibernate are you using? When I remove the config file,
> I get this in the log: (line breaks inserted to prevent wrap and logging
[quoted text clipped - 22 lines]
> build tool. Are you sure that the config file is being built to the
> right place?
I was using 2.1.6 and I upgraded to 2.1.8. The above is almost exactly
what I still get. I am positive that I have a file hibernate.cfg.xml in my
application's WEB-INF/classes folder.
It's the same config file that was at the root of the Eclipse project that
didn't require an absolute path to find it.
Rico.