-->
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: HelloWorld Project in Eclipse: unresolved type
PostPosted: Thu Nov 15, 2007 1:52 pm 
Newbie

Joined: Thu Nov 15, 2007 1:21 pm
Posts: 3
Location: TUDelft
Hi!

I am just begining to use hibernate and following the HelloWorld example on the 'Java Persistence with Hibernate' book.

I am setting up a project using Eclipse on a windows XP platform, and so I installed the hibernate tools for Eclipse on the Java Build Path.

However, while building the helper class HibernateUtil, I found no evidence of the org.hibernate.cfg package, and so there is no Configuration class neither. If this is an Hibernate class and I have installed the Eclipse Hibernate Tools correctly (it asked for the Web Standard Tools Project SDK, which I installed), then something is missing or the code has changed regarding the Eclipse version.

Any hints on how to run this example on the Eclipse platform are welcome.

I am using org.hibernate.eclipse v3.2 beta11, org.apache.ant v1.7 and the JRE is v1.6


Regards,

_________________
____________________
Joao Paulo Hespanha
OTB Research Institute
TUdelft


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 15, 2007 4:03 pm 
Beginner
Beginner

Joined: Fri May 18, 2007 10:28 am
Posts: 48
Location: Madison, WI
Post the error that you get, it is very difficult to troubleshoot.

http://www.warfrog.com/hibernatetutorial/

this is another example u can look @ if it helps.

_________________
Please rate if it helped


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 16, 2007 6:56 am 
Newbie

Joined: Thu Nov 15, 2007 1:21 pm
Posts: 3
Location: TUDelft
The tutorial you refer is using other plugins/applications like midllegen and spring, which I do not intend to use or setup in the Eclipse IDE.

What I need is just the minimum set of libraries to install in the Java Build Path in order to run the HelloWorld example from the Java Persistence with Hibernate book.

Also, I intend to use postgreSQL (and not HSQL) as the database where to write the MESSAGES table. This way, I have added the postgreSQL and the PostGIS jar files to the Build Path. I think I can get a proper configuration if I follow the PostGIS manual section on the JDBC driver.

The editor window errors I am getting for the HibernateUtil class are the following:
(see the <- [...] remarks)

* Startup Hibernate and provide access to the singleton
* SessionFactory
*/
package persistence;

import org.hibernate.*;
import org.hibernate.cfg.*; <- [The import org.hibernate.cfg.* cannot be resolved]

/**
* @author jdafonseca
* Source code for this class is on page 56 of 'Java Persistence
* with Hibernate'
*/
public class HibernateUtil {
private static SessionFactory sessionFactory; <- [SessionFactory can not be resolved to a type]

static {
try {
sessionFactory = new Configuration().configure().buildSessionFactory(); <- [Configuration can not be resolved to a type]

(the remaining part of the code is not shown)

So this apparently shows that the Hibernate Tools for Eclipse pack does not have all that is needed in order to run the example.

Regards,

_________________
____________________
Joao Paulo Hespanha
OTB Research Institute
TUdelft


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