473,395 Members | 1,343 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Urgent need help in Hibernate Configuration file

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;
}


}
May 14 '08 #1
1 4036
JosAH
11,448 Expert 8TB
It has nothing to do with Hibernate nor Connections; read the exception text: your
code is looking for a LogFactory and you didn't tell it where it could find one.

kind regards,

Jos
May 14 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: kathy | last post by:
What Application Configuration File is? And when/where/how to use it? Any documents on that? MSDN has somrthings scatter everywhere - hard to follow. thanks,
1
by: SB | last post by:
What I want to achieve ... Display file names from sql server database, on click the file should open up using test.exe file. Using the following code, I am able to display the files and click on...
0
by: abhishek.srivastav | last post by:
Hi, I have used the following command in db2. EXPORT TO C:\FILENAME.TXT OF DEL LOBS TO C:\ MODIFIED BY LOBSINFILE SELECT * FROM TABLENAME
0
by: Amjath | last post by:
I put all my application updater block dll to GAC, to avoid keeping this dll's in my bin folder. After doing this all i build my project, it works fine, now i run my project it give me an error...
5
by: Water Cooler v2 | last post by:
I know that we can add a single name value entry in app.config or web.config in the configuration/configSettings/appSettings section like so: <add key="key" value="value" /> Question: I want...
5
by: Jay | last post by:
I want to store various text settings in a configuration file, that I will read into C# and make use of. Here's a simplified example of the file: #comment loop(var=1:5){ deviceundertest ...
5
by: Allan Ebdrup | last post by:
I have a webservice in ASP.Net 2.0, I need to store and load a xml configuration file in relation to one of the web methods in my webservice. What's the best place to store and the best way to load...
1
by: psantosh12 | last post by:
Hello Frnds Please need help to resolve error.......... it is very very urgent........ The error is Runtime Error Description: An application error occurred on the server. The current custom...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.