i am using hibernate in netbaens
I am getting exception like this
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
org.hibernate.MappingNotFoundException: file: hib\classes\personVshare.hbm.xml not found
at org.hibernate.cfg.Configuration.addFile(Configuration.java:307)
at org.hibernate.cfg.Configuration.addFile(Configuration.java:293)
this is my client class
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package hib;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
/**
*
* @author SS49938
*/
public class Client {
public static void main(String arg[])
{
Client c=new Client();
try
{
c.insertperson();
}
catch(Exception e)
{
e.printStackTrace();
}
}
public void insertperson()
{
Configuration Config = new Configuration();
Config=Config.configure("hibernate.cfg.xml");
Config=Config.addFile("hib/classes/personVshare.hbm.xml");
SessionFactory sessionFactory = Config.buildSessionFactory();
Session s = sessionFactory.openSession();
Person p=new Person("s","r");
Transaction tx=s.beginTransaction();
s.save(p);
tx.commit();
s.close();
}
}
where to place all xml files
can any one help me
thanks in advance.