-->
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.  [ 3 posts ] 
Author Message
 Post subject: Initial SessionFactory creation failed.java.lang.NoClassDefF
PostPosted: Mon Feb 19, 2007 6:09 pm 
Newbie

Joined: Mon Feb 19, 2007 5:54 pm
Posts: 2
Hi,

this´s my first time using hibernate.
I use Hibernate 3.0, Tomcat and J2ee Servlets.

I get this error when I call
sessionFactory = new Configuration().configure().buildSessionFactory();


....
Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration
log4j:WARN No appenders could be found for logger (org.apache.catalina.session.ManagerBase).
log4j:WARN Please initialize the log4j system properly.
...

I have this libraries in my WE-INF/lib directory
commons-logging.jar
commons-collections.jar
cglib.jar
dom4j.jar
ehcache.jar
log4j.jar
hibernate3.jar
jta.jar
cglib.jar
c3po.jar
asm.jar
asm-attsr.jar

I´m using pool conections with Mysql
I send you my configuration:
//--------------------------------------------
server.xml:
//-------------------------------------------
<Context path="/apoyoTecnico2" docBase="d:\desarrollo\ApoyoTecnicoJ2EE2" debug="0" reloadable="true" crossContext="true">

<Resource name="jdbc/TestDB" auth="Container" scope="Shareable" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="javauser" password="javadude" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/request?autoReconnect=true"/>

</Context>

//------------------------------------------------
hibernate.cfg.xml
//------------------------------------------------

<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>

<!-- Settings for MySQL -->
<property name="dialect"> net.sf.hibernate.dialect.MySQLDialect</property>
<property name = "connection.datasource">java:comp/env/jdbc/TestDB</property>
<property name = "show_sql">false</property>

<!-- Hibernate XML mapping files -->
<mapping resource="Cat.hbm.xml"/>

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


Please, could you help me??

Best Regards

_________________
Miguel Lacosta


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 20, 2007 4:29 pm 
Regular
Regular

Joined: Mon May 22, 2006 2:30 pm
Posts: 74
Your runtime CLASSPATH does not include the hibernate3.jar file. That is why the class loader can't find it.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 21, 2007 4:39 am 
Newbie

Joined: Mon Feb 19, 2007 5:54 pm
Posts: 2
Hi,

Oh, you´re right!! Thanks for you advice!!!
I´m going to try!!!

Best Regards!

_________________
Miguel Lacosta


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.