-->
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.  [ 9 posts ] 
Author Message
 Post subject: Hibernate under netbeans
PostPosted: Fri Sep 05, 2003 12:35 pm 
Beginner
Beginner

Joined: Thu Sep 04, 2003 11:02 am
Posts: 20
Location: Montevideo, Uruguay
Hi,

I-m an absolute begginer in Hibernet. And I got stuck at the very start line.

Mine is a web application that is beeing developed under netbeans (3.5.1)
Following a recomendation from a collegue we are trying to use hibernate to persist our objects on a MySql database.

Now, I have tryed to follow the Quickstart, and anything else I could get my hands on, but could not make it run.

Any hints, tips, whatever is welcome.

----------------------

In my last atempt I have mannaged to make the app run, but get a bunch of exceptions.

I-m thinking maybe I have not configured tomcat well, or the netbeans ide.

I-m at a lost.

Thanks
Mata


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 12:49 pm 
Beginner
Beginner

Joined: Thu Sep 04, 2003 2:50 pm
Posts: 45
Location: US: New York NY
netbeans shouldn't have much to do with things. However, if you are using an embedded tomcat with netbeans, you had better make sure you've got your jars and hibernate.properties in the right spot. For a web app, jars should be in application_folder/WEB-INF/lib and properties in application_folder/WEB-INF/classes

hope that helps, otherwise you should post more info on the exact errors.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 12:52 pm 
Beginner
Beginner

Joined: Thu Sep 04, 2003 11:02 am
Posts: 20
Location: Montevideo, Uruguay
Hi again. More info.

Now I-m getting a

SEVERE: Could not compile the mapping document
java.lang.ClassNotFoundException: Person.class
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)

I don-t know. Person.Class is on the direcotry.

This is a simple example. The person has a name. And i want to save it in the database.

Thanks again
Mata


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 12:57 pm 
Beginner
Beginner

Joined: Thu Sep 04, 2003 2:50 pm
Posts: 45
Location: US: New York NY
make sure the Person.hbm.xml file is in the same location as Person.class

WEB-INF/classes/Person.hbm.xml
WEB-INF/classes/Person.class

Then make sure your mapping has the correct class i.e.
<class
name="Person"
table="person"
>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 1:39 pm 
Beginner
Beginner

Joined: Thu Sep 04, 2003 11:02 am
Posts: 20
Location: Montevideo, Uruguay
Hi again. Thanks for your troubles.

I have moved on a little. Now I can-t find the database.

This is what I get>

Sep 5, 2003 2:37:14 PM net.sf.hibernate.connection.DatasourceConnectionProvider configure
SEVERE: Could not find datasource: AppServ/mysql/data/esee
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640)

Thaks a lot
Mata


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 1:40 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
You should really try the "Quickstart" document again. Also try to read it this time. It's not faster or easier if we read it for you. :)

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 2:50 pm 
Beginner
Beginner

Joined: Thu Sep 04, 2003 2:50 pm
Posts: 45
Location: US: New York NY
much nicer then RTFM :-)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 3:34 pm 
Beginner
Beginner

Joined: Thu Sep 04, 2003 11:02 am
Posts: 20
Location: Montevideo, Uruguay
OK... I apologice If you feel i'm out of my depth. I'm just trying to lean.

I have gone over the Quickstart (once more now). And I know I am missing something obvious (some casesencitive issue- a como somewhere) and I know you can not help me at such level. But maybe just point into the right direction If you have an aswer to my troubles.

Again, I am really at a loss. I'm Tired, frustrated. Even the topics in the beginners forums seem too much for me, SINCE I HAVEN'T BEEN ABLE TO MAKE IT WORK.

Now, I have come agaist new technologies before, and usually, all one need is a little push in the right direction. Give me bread and I'll eat today, teach me how to cook, and I'll eat everyday. (Or Sth among those lines)

Thanks again. And again, I apologice If I am wasteing your time.

Yours
Mata

PS: What does "RTFM" stand for?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 4:01 pm 
Beginner
Beginner

Joined: Thu Sep 04, 2003 2:50 pm
Posts: 45
Location: US: New York NY
did you put hibernate.properties in
application/WEB-INF/classes

is it configured correctly. Could not find datasource seems to suggest that is it is not.

I use postgresql

hibernate.dialect net.sf.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://localhost:5432/mydatabase
hibernate.connection.username user
hibernate.connection.password pass


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