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: Tutorial that works?
PostPosted: Mon Feb 01, 2010 4:33 am 
Newbie

Joined: Mon Feb 01, 2010 4:19 am
Posts: 11
Is there a tutorial that works? There seems to be new versions and old tutorial in the current distro. I can't seem to make it work.

First, the home page says,
"Download Hibernate 3.2 and extract the archive."

But, I go to the download page and I find.
hibernate-distribution-3.3.2.GA-dist.tar.gz

So, not too much of a problem. I download it, open the manual
hibernate-distribution-3.3.2.GA/documentation/manual/en-US/hibernate_reference.pdf

Chapter 1 is a tutorial. Excellent, but I can't get hsqldb to start using maven.

cat pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/
maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.hibernate.tutorials</groupId>
<artifactId>hibernate-tutorial</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>First Hibernate Tutorial</name>
<build>
<!-- we dont want the version to be part of the generated war file name -->
<finalName>${artifactId}</finalName>
</build>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
<!-- Because this is a web app, we also have a dependency on the servlet api. -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
<!-- Hibernate uses slf4j for logging, for our purposes here use the simple backend -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
<!-- Hibernate gives you a choice of bytecode providers between cglib and javassist -->
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
</dependency>
</dependencies>
</project>

But, I go to start hsqldb using the suggested maven command, and I get the following error.

mvn exec:java -Dexec.mainClass="org.hsqldb.Server" -Dexec.args="-database.0 file:target/data/tutorial"

and I get the following error.

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).


Project ID: org.hibernate.tutorials:hibernate-tutorial
POM Location: /home/brian/hibernateTutorial/pom.xml
Validation Messages:

[0] 'dependencies.dependency.version' is missing for org.hibernate:hibernate-core
[1] 'dependencies.dependency.version' is missing for javax.servlet:servlet-api
[2] 'dependencies.dependency.version' is missing for org.slf4j:slf4j-simple
[3] 'dependencies.dependency.version' is missing for javassist:javassist


Reason: Failed to validate POM for project org.hibernate.tutorials:hibernate-tutorial at /home/brian/hibernateTutorial/pom.xm
l


Top
 Profile  
 
 Post subject: Re: Tutorial that works?
PostPosted: Mon Feb 01, 2010 8:15 pm 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Check out my signature links. They even walk you through the use of JPA annotations, which is a current technology, and will make working with Hibernate much, much easier.

Enjoy!

http://www.hiberbook.com/HiberBookWeb/l ... hhibernate

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.