-->
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: Article from community to community guys
PostPosted: Fri Sep 17, 2010 11:43 am 
Newbie

Joined: Fri Sep 17, 2010 11:39 am
Posts: 1
Hi all,
I’m a newbie in hibernate and currently I’m trying to find some good book, tutorial or how -to material to learn how to create a Web Project with Hibernate in Eclipse environment. Until now I found several tutorials but they are tool old (2004) or they do not work properly, I think that because the authors does not mention details and they do not provide the binary file of their applications, further more in the comments of the materials a lot of guys asks for details how to assemble the whole application, but without any responses from the authors. I just want to create a good article from community to community guys and to post it into some educational portals.
The technologies and products that I’m using in my web project are:
Eclipse Galileo + JBoss tool 3.4
MySQL 5.1
JBoss 6.0.3
Hibernate 3.0
JSP + Servlet + EJB 3.0
My first question is – are there any inconsistences when I’m using Jboss 6.0.3 and Hibernate 3.0 and Eclipse Galileo + JBoss 3.4. And what landscape set up you would recommend me for educational purpose?
My second question is what would be the architecture of this type of application? I saw in one tutorial this “architecture”:
1.Utility Project – contains .har file which consists of hibernate.cfg.xml, hibernate.reveng.xml, service-hibernate.xml and some reverted pojo files.
2. Dynamic Web application – this project is build time link with the Utility Project. The project contains some JSPs, Servlets and stateless and stateful java beans.
3. EAR File – This file should contain the Dynamic Web app’s .war and . jar files and the Utility Project .har file.
I tried several times to create an application but I did not succeed. First I created a “Utility Project” with hibernate.cfg.xml that links the project with my schema in the MySQL. So far everything works well. After the link I’m riveting the db schema with Hibernate revert tool and the tool successfully created some files in my project. Also I’m creating an service-hibernate.xml for the SessionFactory resolving from the JNDI. I saw that after version 5.0 of JBoss AS were introduced a new framework Virtual Deployment Framework which enables the capability to resolve the SessionFactory from the JNDI.
My next question is how to create a .har file from this utility project and is this the right way for creating a “hibernate application”?
My next step is to create a “Dynamic Web Project” and EAR project for the deployment. The dynamic project has a build time reference to the Utility Project. I need this link because of the pojos file. So far everything is fine, but when I’m exporting the ear file, it does not contain the .har file or any file from the Utility project. I suppose that the reason is that I have only build time reference instead of deploy time reference.
My question is do I need to create a .har file and import it into the .ear file, or just to put the hibernate files into the .ear file?
I thing that if I found answers for these key-stones question, I could prepare a good article.
Every help or suggestion for good and working materials is appreciated!
Before decided to post this new topic, I’ve searched for similar topics in different portal and tried some example from this resources:
http://www.packtpub.com/article/develop ... ibernate-1
http://www.wikihow.com/Generate-Hiberna ... -DB-Tables
http://www.laliluna.de/articles/first-h ... orial.html
book - JBoss AS 5 Development Dec 2009
book - JBoss Tools 3 Developers Guide Apr 2009


Top
 Profile  
 
 Post subject: Re: Article from community to community guys
PostPosted: Thu Nov 04, 2010 8:45 am 
Newbie

Joined: Wed Oct 27, 2010 10:19 am
Posts: 2
This one worked our for me - took a bit of work to get everything up and running
http://www.skill-guru.com/blog/2009/08/ ... xperience/

If you cut/paste the code take a close look at all single and double quotes in the ...cfg.xml file to make sure that they they are the correct chars (would have saved me a hour or so). You may need a few more JARs then the ones that they list esp the JPA jar. Make sure that you have the correct database driver.

--CJ


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