Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Packaging Hibernate files in a HAR file

 
Eugene Abarquez
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am developing a Hibernate application using JBoss 4, and I gathered that JBoss can easily manage your configuration details by deploying your application as a Hibernate Archive file (HAR).

So my question is, how do you package your hibernate files into a HAR file? I am guessing it will be through the use of ANT or Eclipse (I am using Eclipse 3.1.2, but not MyEclipse though). Does anybody know how to go about this? Online tutorials, references, etc. will be a big help.

Thanks in advance.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A har file is simply an archive file just like a jar file is. Most common location for config and mapping files are the hibernate.cfg.xml is in the root classpath directory, so the directory you zip/jar from, then your mapping files are in subdirectories from that root directory, usually with the POJO classes.

example

c:\myApp\src\java\com\mycompany\model

so the hibernate.cfg.xml is in the c:\myApp\src\java\ directory and all the POJOs and mapping files are in the c:\myApp\src\java\com\mycompany\model.

Sometimes the hibernate.cfg.xml is in some other directory and when using ant it compiles the java code into some classes directory with the same directory structure that is under src c:\myApp\src\java and then copy the hibernate.cfg.xml into the root of those compiled classes directory.

Mark
 
Eugene Abarquez
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark for the reply.

I did some research and I found some useful information in this site: JBoss 4 Guide

What I don't get though is how to package a HAR file. In the same way that you package a JAR? (Package the files into a .jar and rename it as .har? )

And what tools are you going to use to do this?

Thanks.

[ October 11, 2006: Message edited by: Eugene Abarquez ]
[ October 11, 2006: Message edited by: Eugene Abarquez ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, exactly. However you choose to zip the file up, just have the name of the file have .har as the extension. All Archive files jar, sar, tar, war, ear, rar, har are just zipped files. zipped from the same tools, just named differently.

So WinZip, jar -cvm, pkzip, any zipping tool works. you can zip it into a .zip file and go to Windows explorer and rename it to .har.

I think this is a case of trying to think that it is really a complicated thing when it is not.

Mark
 
Eugene Abarquez
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic