aspose file tools*
The moose likes Object Relational Mapping and the fly likes In hibernate Follwowing error occured Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "In hibernate Follwowing error occured "Error reading resource: Department.hbm.xml"" Watch "In hibernate Follwowing error occured "Error reading resource: Department.hbm.xml"" New topic
Author

In hibernate Follwowing error occured "Error reading resource: Department.hbm.xml"

naga ravipati
Greenhorn

Joined: Nov 08, 2006
Posts: 3
This is the o/p i got
<--- o/p --->
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
java.lang.NullPointerException
at com.ibm.hibernate_article.InsertDept.main(InsertDept.java:66)
Exception in thread "main" Error reading resource: Department.hbm.xml
<--- o/p -->

I used department table in db2 and department bean in java.

follwing are the files i used








Suggest me some answer

thanks

[ Edited to include code tags - Paul Sturrock ]
[ November 09, 2006: Message edited by: Paul Sturrock ]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9343
    
111

Exception in thread "main" Error reading resource: Department.hbm.xml


This is just part of the exception that you might be seeing. Unless you post the entire stacktrace, i can just do some guess work. Looks like you have not placed the Department.hbm.xml in the right place and hibernate is not able to locate it.


[My Blog] [JavaRanch Journal]
sure nandu
Greenhorn

Joined: Oct 16, 2006
Posts: 18
hai naga ravipati,

try putting both hibernate.cfg.xml and department.hbm.xml
in to classpath and run the application. please tell about the result.
naga ravipati
Greenhorn

Joined: Nov 08, 2006
Posts: 3
I created one variable configxml under this c:/hibernate/Test hibernate.cfg.xml,department.hbm.xml are there.I am using WSAD .Iadded through ADD VAriable.still I am getting Error reading resource "department.xml".
Directory Structure is
Test:
:roseindia.tutorial.hibernate
: Department.java
: :FirstExample.java
epartment.hbm.xml
:hibernate.cfg.xml
: Libraraies

Suggest me some answer. thanks

[ Edited to disable smilies - Paul Sturrock ]
[ November 10, 2006: Message edited by: Paul Sturrock ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: In hibernate Follwowing error occured "Error reading resource: Department.hbm.xml"
 
Similar Threads
Hibernate Issue
Hibernate mapping no good?
Joining tables
Hibernate exception for one-to-one mapping
Annotations exception