-->
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: no hibernate java classes seen in eclipse
PostPosted: Fri Mar 02, 2007 5:44 am 
Newbie

Joined: Thu Mar 01, 2007 11:37 am
Posts: 3
Location: Munich,DE
HibernateUtil can not compile due to org.hibernate.cfg empty.
Unzipped hib-core to my java dir. Imported hibernate3.jar file in eclipse 3.2.1. Many packets logged, but in white color.
e.g. org.hibernate contains two DTD's, but no java classes.
Do I need to compile anything beforehand ?

First time hibernate user, reading chapter 2 of "Java Persistence with Hibernate" so far.

Hibernate version:3.2.2 GA + annotations + em + tools

Name and version of the database you are using: MySql 5.0 with Connector/J 3.1


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 02, 2007 6:19 am 
Beginner
Beginner

Joined: Thu Feb 22, 2007 6:08 am
Posts: 35
HI. Im a newbie, and i just created a webapp with:

Hibernate Core 3.2.2.GA


certify that:

1) you have all the packages necessary
* From Hibernate EntityManager:
o hibernate-entitymanager.jar
o hibernate-annotations.jar
o jboss-archive-browsing.jar
o javassist.jar
* From Hibernate Core
o hibernate3.jar
o antlr-2.7.6.jar
o asm-attrs.jar
o asm.jar
o c3p0-0.9.0.jar
o cglib-2.1.3.jar
o commons-collections-2.1.1.jar
o commons-logging-1.0.4.jar
o concurrent-1.3.2.jar
o dom4j-1.6.1.jar
o ehcache-1.2.3.jar
o log4j-1.2.11.jar
You can find these libs on the respective lib directory on each project, wich you can download on the www.hibernate.org site.

2) you have created on the root directory of the src files (outside of any package) a directory "META-INF" with the "persistence.xml" file with the configuration of the persistence-unit. Remember when you are creating the EntityManagerFactory with the follow line code, you have to use the same name of the specifyed on the persistence-unit tag of the persistence.xml file:

Code:
EntityManagerFactory  emf = Persistence.createEntityManagerFactory("persistence_unit_name");


for tests propose i advise you to create a hibernate tool so you can test if your annotations are well defined and well exported to the DB with the hbm2ddl tool.

Hope the tips were useful.

--ms


Top
 Profile  
 
 Post subject: "solution" found
PostPosted: Fri Mar 02, 2007 8:04 am 
Newbie

Joined: Thu Mar 01, 2007 11:37 am
Posts: 3
Location: Munich,DE
Thanks for your help,
I had the required libs (besides JBoss, currently using SE6 only), but most where empty too. Now I've found a different installation path in Eclipse, using buildpath->load external archives. This imports all jars correctly, with classes and all, while import->archives didn't. Should RTFM the Eclipse book to find what's the diff. Obviously not a hibernate problem - sorry, wrong forum.


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.