<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><hibernate-configuration>
<session-factory>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/stu</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<mapping resource="com/jsj/struts/forms/LoginForm.hbm.xml"/>
</session-factory>
</hibernate-configuration><?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC 
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.jsj.struts.forms"> <class name="com.jsj.struts.forms.LoginForm" table="admi" lazy="false">

<id name="id" column="uid" type="int">
<generator class="increment"/>
</id>

<property name="uname" column="uname" type="string"/>
<property name="password" column="password" type="string"/>
</class>
</hibernate-mapping>

package com.jsj.hibernate.utils;import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;public class HibernateUtils {
private static SessionFactory factory;

static{
Configuration conf = new Configuration().configure();
factory = conf.buildSessionFactory();
}

public static Session getSession(){
return factory.openSession();
}

public static void closeSession(Session session){
if(session != null)
session.close();
}
}
public class Hib_db implements IHib_db{ public void insert(LoginForm loginForm) {
Session session = null;
Transaction tr = null;
try {
session = HibernateUtils.getSession();
System.out.println("dfadfasdfasdfa");
tr = session.beginTransaction();
session.save(loginForm);
tr.commit();
} catch (Exception e) {
System.out.println("注册失败");
}finally{
if(session != null){
session.close();
}
}
}

public static void main(String []args){
Hib_db db = new Hib_db();
LoginForm loginForm = new LoginForm();
loginForm.setUname("nihao");
loginForm.setPassword("nihao");
db.insert(loginForm);
}

}一运行就弹出log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.jsj.hibernate.db_hibernate.impl.Hib_db.insert(Hib_db.java:16)
at com.jsj.hibernate.db_hibernate.impl.Hib_db.main(Hib_db.java:35)
Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1329)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1351)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1338)
at com.jsj.hibernate.utils.HibernateUtils.<clinit>(HibernateUtils.java:11)
... 2 more这个错误怎么解决啊!