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.  [ 1 post ] 
Author Message
 Post subject: Hibernate + Derby + *Maven
PostPosted: Mon Nov 15, 2010 10:51 am 
Beginner
Beginner

Joined: Mon Nov 15, 2010 10:39 am
Posts: 27
Hi all.

I am trying to set up Hibernate to work with Apache Derby (embedded mode), as well as Maven, and i'm a bit confused. Would be nice with some help from someone who has used this combination before. I have used Hibernate on another project, but never set it up, so it's all a bit confusing at the moment.

So far, I have set up the pom.xml of Maven to include Hibernate (using code i found online):
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.2.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>3.3.0.ga</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.4.0.GA</version>
</dependency>

as well as using Derby:

<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
<version>10.4.2.0</version>
</dependency>

I have also created a hibernate.cfg.xml file, containing the following properties:

<property name="connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
<property name="connection.url">jdbc:derby;safetyinformation;</property>
<property name="dialect">org.hibernate.dialect.DerbyDialect</property>

My questions at the moment are:

What folder should i put the hibernate.cfg.xml file in? (I'm using eclipse, right now it is in the project root.)

I'm not sure if I can load the cfg file properly, since a simple test
try {
Configuration config = new Configuration();
} catch (Throwable ex) {
System.err.println("ex.toString());

}
yields "java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration"

Do I need to have the Derby db running seperatly in order to make this work?

Thanks in advance for any answers, i'll keeping hacking at it..

- Tobb


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

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.