aspose file tools*
The moose likes Object Relational Mapping and the fly likes log4j errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "log4j errors" Watch "log4j errors" New topic
Author

log4j errors

Venkat dasari
Ranch Hand

Joined: Nov 12, 2003
Posts: 67
HI,
When i am trying to run my first program ki am finding the following errors:

log4j:WARN No appenders could be found for logger (net.sf.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
java.lang.ExceptionInInitializerError
at com.ats.axsis.service.workflow.demo.EmpTest.<clinit>(EmpTest.java:32)
Caused by: net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found
at net.sf.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:872)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:896)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:883)
at com.ats.axsis.service.workflow.demo.EmpTest.<clinit>(EmpTest.java:28)
Exception in thread "main"



please provide a solution to this...
Thanks in advance
venkat Dasari


Regards,<br />Venkat Dasari<br />SCJP 1.4, SCBCD.
Ta Ri Ki Sun
Ranch Hand

Joined: Mar 26, 2002
Posts: 442
Originally posted by Venkat dasari:

please provide a solution to this...


from you topic it seems you want a solution to the log4j errors.

copy the following into a file named log4j.properties and put the file in your project root as you did with hibernate properties.


### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

### direct messages to file hibernate.log ###
#log4j.appender.file=org.apache.log4j.FileAppender
#log4j.appender.file.File=hibernate.log
#log4j.appender.file.layout=org.apache.log4j.PatternLayout
#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

### set log levels - for more verbose logging change 'info' to 'debug' ###

log4j.rootLogger=debug, stdout

log4j.logger.net.sf.hibernate=info

### log just the SQL
log4j.logger.net.sf.hibernate.SQL=debug

### log JDBC bind parameters ###
log4j.logger.net.sf.hibernate.type=info

### log schema export/update ###
log4j.logger.net.sf.hibernate.tool.hbm2ddl=debug

### log cache activity ###
log4j.logger.net.sf.hibernate.cache=debug

### enable the following line if you want to track down connection ###
### leakages when using DriverManagerConnectionProvider ###
log4j.logger.net.sf.hibernate.connection.DriverManagerConnectionProvider=trace



that logs alot of info, so turn off whatever you don't want to see.
Venkat dasari
Ranch Hand

Joined: Nov 12, 2003
Posts: 67
HI,
Thans for the help..It worked well.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: log4j errors