-->
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: Running hibernate in a main method
PostPosted: Tue May 23, 2006 4:46 pm 
Newbie

Joined: Tue May 23, 2006 4:40 pm
Posts: 3
We have developed a reporting process that only needs to run once a month and depends on the creation of some data in another system. We are planning to have the job which creates the data we need kick off another java job which generates the data for a web report.

The code we've developed works just fine in a web application. When we try to execute the same code from a main method we run into issues with hbm files being found. I suspect this is because the initialization which is done by the server isn't occuring in the batch mode we are attempting to use.

Can anyone point me to a resource or suggest how we can overcome these issues?

Thanks,

Chris


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 23, 2006 5:26 pm 
Regular
Regular

Joined: Thu Jul 08, 2004 1:21 pm
Posts: 68
Location: Recife - Pernambuco - Brazil
You must configure your classpath to include the root directory for package which contains hbm. For example, if you have the following directory structure:
classes/com/company/project/model/

"classes" dir must be in your classpath.

Kind Regards.

_________________
Marcos Silva Pereira
http://blastemica.blogspot.com


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 25, 2006 11:16 am 
Newbie

Joined: Tue May 23, 2006 4:40 pm
Posts: 3
The hibernate files all live within a jar which is referenced in the buildpath of the batch project set up in WSAD.

The references within that jar point to files that are in the referenced places within the jar's components.

Chris


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 26, 2006 12:36 am 
Expert
Expert

Joined: Thu May 26, 2005 9:19 am
Posts: 262
Location: Oak Creek, WI
Do Elaborate us to help you out.
I run hibernate code in WSAD and don't see any problem.

Show us the code and error traces etc.....

_________________
RamnathN
Senior Software Engineer
http://www.linkedin.com/in/ramnathn
Don't forget to rate.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 26, 2006 9:28 am 
Newbie

Joined: Tue May 23, 2006 4:40 pm
Posts: 3
It actually turned out to be an issue in a hibernate utility class and how it was setting its self up to reference the hbm files. Basically it was appending the whole project path to the package on to the reference tot he hbm files in the jar and of course those files in a package with a path that looked like that did not exist.

Thanks for the help.

Chris


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 27, 2006 12:50 am 
Regular
Regular

Joined: Thu Jul 08, 2004 1:21 pm
Posts: 68
Location: Recife - Pernambuco - Brazil
Are hbm.xml and .class together at the same directory? I never used hbm files into a .jar without put them together with .class.

Kind Regards,

_________________
Marcos Silva Pereira
http://blastemica.blogspot.com


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.