-->
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.  [ 6 posts ] 
Author Message
 Post subject: Standalone App--where do the jars go?
PostPosted: Wed Nov 17, 2004 1:57 pm 
Beginner
Beginner

Joined: Thu Apr 29, 2004 12:45 pm
Posts: 45
Hello,

Does anyone know if there is a standard way to embed Hibernate in a standalone application?

For example, if I include hibernate2.jar in Application.jar, then the classloader won't find it. The only ways I can think of are to either:

1).unpackage hibernate2.jar and put its bare contents into Application.jar

or

2).with Class-Path reference from Application.jar to hibernate2.jar and run them side-by-side, .


Both of these methods seem kind of sloppy. Would it be better to create a custom classloader in Application.jar to load hibernate2.jar? Or is there a better way?

I'd appreciate any thoughts. Thanks in advance.

Itchy


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 1:59 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
This is not meant to be rude, but don't you think a basic Java introduction would be useful material for you? Of course you reference both JARs, this is called classpath. It is very likely that you will also add other JARs to your classpath for a full application, e.g. your JDBC driver.

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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 2:28 pm 
Beginner
Beginner

Joined: Thu Apr 29, 2004 12:45 pm
Posts: 45
>This is not meant to be rude, but don't you think a basic Java introduction would be useful material for you?

Thanks for the advice; however, I think you misunderstood my question. And I don't think the answer would be found in an introductory text. In fact, the answer doesn't appear in my advanced text either.



>Of course you reference both JARs, this is called classpath.

I realize that classpath references are needed for jars.



>It is very likely that you will also add other JARs to your classpath for a full application, e.g. your JDBC driver.

Again, here is my question rephrased: Can all of these jars (hibernate2.jar, JDBC.jar, etc) be placed inside of a single jar?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 2:29 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
No, they can't. I also think this is not Hibernate-related.

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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 2:32 pm 
Beginner
Beginner

Joined: Thu Apr 29, 2004 12:45 pm
Posts: 45
I only asked it here because I figured this is a normal situation that hibernate developers encounter.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 2:34 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Uhm, thats the case for any Java application that needs more than one class and the JDK libraries. So, you are right, its a very common Java problem.

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


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