-->
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.  [ 5 posts ] 
Author Message
 Post subject: hibernate.cfg.xml file not found within orion app server
PostPosted: Fri Sep 05, 2003 10:36 am 
Beginner
Beginner

Joined: Fri Sep 05, 2003 10:17 am
Posts: 42
i am deploying an ear file to the orion app server and have in the root of the ear file the hibernate.cfg.xml file. Within the ear file i have an ejb jar file that has a ejb class that calls:
Code:
Configuration cfg = new Configuration().configure();

to load the hibernate.cfg.xml file. When this happens i get an error in my log file:

INFO [RMICallHandler-4] (Configuration.java:689) - Configuration resource: /hibernate.cfg.xml

WARN [RMICallHandler-4] (Configuration.java:693) - /hibernate.cfg.xml not found

From what i have read, it appears the hibernate.cfg.xml file is usually placed in the WEB-INF/classes dir, but with an ear file (only has EJB jar files and application jar files) i do not have this directory. Therefore the question is simple, where do i place the hibernate.cfg.xml file so that it is seen by the Configuration object? The simple answer is in the root of the classpath. However based on my configuration with a single ear file that contains many jar files where the hibernate.cfg.xml file lives at the same level in the ear as the jars how do i make the hibernate.cfg.xml visible?

thanks in advance for your reply.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 11:13 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
This is actaully a ear/jar issue. What you need to do is to keep the hibernate config file in the root of the ear, but then in your ejb jar file add a manifest class path entry for "."

If you use ant, when generating your ejb jar file do something like:
Code:
<jar jarfile="ejb-basic.jar" compress="true">
    ...
    <manifest>
        <attribute name="Class-Path" value="."/>
    </manifest>
</jar>


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 06, 2003 7:51 am 
Beginner
Beginner

Joined: Fri Sep 05, 2003 10:17 am
Posts: 42
Thank you Steve I will give this a try and report back.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2003 7:50 am 
Beginner
Beginner

Joined: Fri Sep 05, 2003 10:17 am
Posts: 42
Just letting you know that this worked. Thanks again for your help!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 07, 2004 12:20 pm 
Newbie

Joined: Sun Feb 01, 2004 5:45 pm
Posts: 4
derrickhackman wrote:
Just letting you know that this worked. Thanks again for your help!


Hi,

I follow above instruction, but Orion still could NOT found hibernate.cfg.xml.

Finally found a solution by efender (Eric Fenderbosch) Date: 2003-07-28 11:15 :
Moving hibernate2.jar from the system CLASSPATH to inside of the EAR fixed it. The application classloader can now find it just fine.


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