I get this error when configurating my hibernate
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).
log4j:WARN Please initialize the log4j system properly.
here is the line of code
Configuration config = new AnnotationConfiguration().configure("HibernatePositionServer.cfg.xml");
and here is my cfg file
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!--<property name="connection.url">jdbc:mysql://[Here i put correct IP:Port]/settings</property>-->
<!--<property name="connection.url">jdbc:mysql://127.0.0.1:1433/settings</property>-->
<property name="connection.driver_class">org.gjt.mm.mysql.Driver</property>
<property name="connection.username">root</property>
<property name="connection.password">Programa17</property>
<property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.c3p0.timeout">300</property>
<property name="hibernate.c3p0.idle_test_period">150</property>
<property name="hibernate.c3p0.min_size">1</property>
<property name="hibernate.c3p0.max_size">1</property>
<!-- DB schema will be updated if needed -->
<property name="hibernate.show_sql">true</property>
<property name="hbm2ddl.auto">update</property>
<!--<property name="hbm2ddl.auto">update</property>-->
<property name="dialect">org.hibernate.dialect.MySQL5Dialect</property>
</session-factory>
First ask Google, this is one of the most common Log4J error messages. Simply put: Log4J (logging and monitoring framework) received a logging message from Hibernate and does not know what to do with it (print on console, put in file, ignore…?)
Put file named
log4j.xmlin your CLASSPATH root directory (src/main/resourcewhen using maven) with the following contents: