• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
naga ravipati
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sure nandu
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic