-->
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: Eclipse - Hibernate Help
PostPosted: Mon Jan 30, 2006 3:21 am 
Newbie

Joined: Mon Jan 30, 2006 3:14 am
Posts: 5
I am using MyEclipse, and trying to connect up my simple application with my database. My application works fine, but when I create the jar, none of my Hibernate functionality works at all. This appears to be a classpath of sorts issue within ANT, but thought I'd try for help here as well. What all do I need to include in my final jar in order for my final stand alone application to retain its Hibernate functionality? Below is a portion of my ANT build.xml file so you can see what all I have included. All of my *.JAR files are in the /lib directory.

Code:
   

<target name="CreateExecutableJarFileWithExternalLibrary"                 
                                                                    depends="clean, build" >
   <jar destfile="${jarFile}">
        <fileset dir="${buildDir}"/>
        <fileset dir="${libDir}" />
   <manifest>
           <attribute name="Main-Class" value="org.boss.kpoint.KPoint1" />
   </manifest>
   </jar>
</target>



Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 30, 2006 4:15 am 
Pro
Pro

Joined: Mon Jan 24, 2005 5:39 am
Posts: 216
Location: Germany
This looks like you are trying to put jars inside another jar.
This doesnt work.
Try to place all of your own jars and all jars from hibernate/lib
directory in one directory on your target machine.
An write a start script like this (windows):

Code:
@echo off

set jarpath=lib
set jars=%jarpath%\hibernate3.jar;
... all other hibernate jars you need
set jars=%jars%;%jarpath%\myjar1.jar;
... all other of your own jars
set cppath=.;%jars%

rem Batch-Modus
java -cp %cppath% x.y.myMainClass

_________________
dont forget to rate !


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 30, 2006 3:03 pm 
Newbie

Joined: Mon Jan 30, 2006 3:14 am
Posts: 5
I fixed my problem with the following:

Code:
<target name="zip" depends="clean,build">
      <echo> IN THE: zip</echo>
      <jar destfile="C:\Zip.jar">
       <zipgroupfileset dir="${libDir}" includes="*.jar"/>
       <fileset dir="${buildDir}" />
         <manifest>
            <attribute name="Main-Class" value="org.boss.kpoint.KPoint1" />
         </manifest>
      </jar>
   </target>



It appears that I somewhat did what you had suggested, but I may be wrong. I am still new to Hibernate.

Thanks,
Sean

P.S. If you (or anyone else) could recommend a good book on Hibernate, I would appreciate it. Thanks


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.