-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: NoClassDefFoundError: org/apache/commons/logging/LogFactory
PostPosted: Fri Jan 28, 2011 3:30 am 
Newbie

Joined: Fri Jan 28, 2011 2:45 am
Posts: 4
hi
I am new to Hibernate and was following the hibernate reference pdf.

can any body help me on this .

i paste the cfg file and the hbm.xml

i use Oracle 10g as DB and JDBC version is 9

But i am able to locate the logfactory class with the commonslogging jar.


as i followed and built a sample,it throws the following error



Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
Exception in thread "main" java.lang.ExceptionInInitializerError
at util.HibernateUtil.<clinit>(HibernateUtil.java:17)
at events.EventManager.createAndStoreEvent(EventManager.java:15)
at events.EventManager.main(EventManager.java:40)
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:110)
at util.HibernateUtil.<clinit>(HibernateUtil.java:11)
... 2 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 4 more



**************************************************
cfg.xml
**********************************************

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<!--Database Settings -->
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:localhost:1521:orcl</property>
<property name="connection.username">scott</property>
<property name="connection.password">test</property>


<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>

<!-- SQL Dialect -->
<property name = "dialect">org.hibernate.dialect.OracleDialect</property>

<property name="current_session_context_class">jta</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="current_session_context_class">thread</property>


<property name="show_sql">true</property>



<mapping resource="events/hbm.xml"/>

</session-factory>
</hibernate-configuration>

*******************************************************************
hbm.xml
*******************************************************************

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="events.Event" table="EVENTS">
<id name="id" column="EVENT_ID">
<generator class="native" />
</id>
<property name="date" type="timestamp" column="EVENT_DATE" />
<property name="title" />
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: Re: NoClassDefFoundError: org/apache/commons/logging/LogFactory
PostPosted: Fri Jan 28, 2011 5:19 am 
Newbie

Joined: Fri Jan 28, 2011 2:45 am
Posts: 4
I found that few jars were not in the right path and placed those properly

now i get "No TransactionManagerLookup specified"

help needed pls


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.