-->
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: NoClassDefFoundError
PostPosted: Mon Jan 29, 2007 5:48 pm 
Newbie

Joined: Fri Jan 26, 2007 3:51 pm
Posts: 16
Hi,

I'm trying to run my first hibernate application but I'm stuck. My persistence.xml file looks like so:

Code:
<persistence-unit name="scholastic">

       <properties>
          <!-- Only scan and detect annotated entities -->
           <property name="hibernate.archive.autodetection" value="class, hbm"/>

          <!-- Only scan and detect hbm.xml files
          <property name="hibernate.archive.autodetection" value="hbm"/>
          -->

          <!-- SQL stdout logging
           -->
          <property name="hibernate.show_sql" value="true"/>
          <property name="hibernate.format_sql" value="true"/>
          <property name="use_sql_comments" value="true"/>

           <!-- We have a JTA data source... -->
          <property name="hibernate.connection.driver_class"
                    value="org.hsqldb.jdbcDriver"/>
          <property name="hibernate.connection.url"
                    value="jdbc:hsqldb:hsql://localhost"/>
          <property name="hibernate.connection.username"
                    value="sa"/>

          <property name="hibernate.c3p0.min_size"
                    value="5"/>
          <property name="hibernate.c3p0.max_size"
                    value="20"/>
          <property name="hibernate.c3p0.timeout"
                    value="300"/>
          <property name="hibernate.c3p0.max_statements"
                    value="50"/>
          <property name="hibernate.c3p0.idle_test_period"
                    value="3000"/>
           

          <property name="hibernate.dialect"
                    value="org.hibernate.dialect.HSQLDialect"/>         

           
      </properties>
   </persistence-unit>

</persistence>


Straight forward from what I can tell. Then when I actually run the app everything seems to be going good until I get to the line that says:

[java] Exception in thread "main" java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/PoolConfig

I don't know what that means, why it's even looking for this class, or where it's supposed to be. My console readout is as follows:

run:
[java] Hibernate EntityManager 3.2.1.GA
[java] Hibernate Annotations 3.2.1.GA
[java] Hibernate 3.2.1
[java] hibernate.properties not found
[java] Bytecode provider name : cglib
[java] using JDK 1.4 java.sql.Timestamp handling
[java] Binding entity from annotated class: scholastic.models.User
[java] Bind entity scholastic.models.User on table USERS
[java] Binding entity from annotated class: scholastic.models.Company
[java] Bind entity scholastic.models.Company on table COMPANIES
[java] Binding entity from annotated class: scholastic.models.Student
[java] Bind entity scholastic.models.Student on table STUDENTS
[java] Binding entity from annotated class: scholastic.models.Administrator

[java] Bind entity scholastic.models.Administrator on table ADMINISTRATORS
[java] Binding entity from annotated class: scholastic.models.Instructor
[java] Bind entity scholastic.models.Instructor on table INSTRUCTORS
[java] C3P0 using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hsql://
localhost
[java] Connection properties: {user=sa, autocommit=true, release_mode=auto}

[java] autocommit mode: true
[java] Exception in thread "main" java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/PoolConfig
[java] at org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:84)
[java] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
[java] at org.hibernate.ejb.InjectionSettingsFactory.createConnectionPr
ovider(InjectionSettingsFactory.java:29)
[java] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
[java] at org.hibernate.cfg.Configuration.buildSettingsConfiguration.java:2006)
[java] at org.hibernate.cfg.Configuration.buildSessionFactoryConfiguration.java:1289)
[java] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory
(Ejb3Configuration.java:713)
[java] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
[java] at javax.persistence.Persistence.createEntityManagerFactory(Pers
istence.java:51)
[java] at javax.persistence.Persistence.createEntityManagerFactory(Pers
istence.java:33)
[java] at scholastic.models.Test.main(Unknown Source)
[java] Java Result: 1

What is going on? How do I fix it?

Please advise,

Alan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 29, 2007 7:07 pm 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
You're missing the C3P0 connection pooling library. Add it to the classpath and you should make a step forward :-).

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 29, 2007 8:29 pm 
Newbie

Joined: Fri Jan 26, 2007 3:51 pm
Posts: 16
Yeah, that was it. Now that it ran, I have to figure out some other problem. I may post something about that later.

For now, thanks!


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.