I am getting this error.....
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.hibernate.cfg.Configuration.<clinit>(Configura tion.java:120)
at com.author.hbn.HibernateUtil.<clinit>(HibernateUti l.java:12)
at com.author.app.Abhi.main(Abhi.java:13)
Configuration file looks like this
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration SYSTEM "hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">oracle.jdbc.OracleD river</property>
<property name="connection.url">jdbc:oracle:thin:@10.208.7.3 5:1521:SAPETRM</property>
<property name="connection.username">sapetrmdev</property>
<property name="connection.password">sapetrmdev</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.Oracle9Dialec t</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<mapping resource="conf/Trader.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Hibernate Util file where i am creating Connection Looks likes this...
package com.author.hbn;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.dom4j.*;
public class HibernateUtil {
private static final SessionFactory sessionFactory;
static {
try {
// Create the SessionFactory from hibernate.cfg.xml
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Exception ex) {
// Make sure you log the exception, as it might be swallowed
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
}