Hibernate and log4j config under Tomcat.
From: Rico (ras_nas_at_yahoo.com)
Date: 02/18/05
- Next message: Wiseguy: "Re: Getting the last modified date of a table"
- Previous message: 400PM: "Re: Java & MySQL show table status command"
- Next in thread: Ryan Stewart: "Re: Hibernate and log4j config under Tomcat."
- Reply: Ryan Stewart: "Re: Hibernate and log4j config under Tomcat."
- Reply: Rico: "Re: Hibernate and log4j config under Tomcat."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 18 Feb 2005 10:04:17 +0800
"Under Tomcat 3.x and 4.x, you should place the log4j.properties under the
WEB-INF/classes directory of your web-applications. Log4j will find the
properties file and initialize itself. This is easy to do and it works."
"The XML configuration file is placed in the context classpath
(WEB-INF/classes), as hibernate.cfg.xml"
I don't know what's Tomcat's problem but in both cases, despite what the
documentation says, placing the config files in WEB-INF/classes didn't
work.
For log4j I ended up using an initialization servlet.
For Hibernate, I placed the xml file in several folders after some
googling:
WEB-INF/classes ; WEB-INF/classes/<path to class file> ; WEB-INF/src ;
<tomcat_home>/conf
Nothing worked and this time Tomcat explicitly told me that the file is
not to be found. I ended up having to specify an absolute path to at least
see that the code I'm actually interested in works.
I don't know what's Tomcat's problem... or mine...
Rico.
- Next message: Wiseguy: "Re: Getting the last modified date of a table"
- Previous message: 400PM: "Re: Java & MySQL show table status command"
- Next in thread: Ryan Stewart: "Re: Hibernate and log4j config under Tomcat."
- Reply: Ryan Stewart: "Re: Hibernate and log4j config under Tomcat."
- Reply: Rico: "Re: Hibernate and log4j config under Tomcat."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]