I am using hibernate right now, and I have the problem below;
Code:
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Somehow, i cannot initialize log4j file properly but I do not know what on earth is going on.
I appreciate your comments.
This is the main class(I am hiding some descriptions by /** */, though)
Code:
package roseindia.tutorial.hibernate;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.apache.log4j.*;
public class Exec {
public static void main(String[] args) {
Session session = null;
try{
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
session = sessionFactory.openSession();
}catch(Exception e){}
/**
Contact contact = new Contact();
contact.setId(3);
contact.setFirstName("Deepak");
contact.setLastName("Kumar");
contact.setEmail("deepak_38@yahoo.com");
session.save(contact);
}catch(Exception e){
System.out.println(e.getMessage());
}finally{
session.flush();
session.close();
}
*/
}
}
And this is the configuration file;
Code:
<?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="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@192.168.120.0:1521:ORCL</property>
<property name="hibernate.connection.username">kei</property>
<property name="hibernate.connection.password">sugano</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping class="roseindia.tutorial.hibernate.Contact"/>
<mapping class="roseindia.tutorial.hibernate.HibernateUtil"/>
<mapping class="roseindia.tutorial.hibernate.Exec"/>
<mapping class="roseindia.tutorial.hibernate.SessionFactoryHelper"/>
<!-- Mapping files -->
<mapping resource="contact.hbm.xml"/>
</session-factory>
</hibernate-configuration>
DO you have any idea what to do next?