File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with running my first Hibernate App

 
Varun Nayudu
Ranch Hand
Posts: 159
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I m trying to run my first web application using Hibernate/Tomcat/Oracle10g

My web application structure is quite simple
index.jsp -> servlet -> insert data into the database(Oracle10g)

The webApp struture is showed in the attachment

I have my hibernate.cfg.xml ,hibernate.hbm.xml, HibernateUtil, hibenrateListener in my WEB-INF -> classes

hibernate.cfg.xml


hibernate.hbm.xml


HibernateUtil



hibenrateListener


Through the net i also came across a java class file to insert data into the EMPLOYEE table




the code compiles fine but gives an error



Please tell me what is the problem .
regards
Untitled.png
WebApp struture
[Thumbnail for Untitled.png]
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This means that you have done something wrong in the hibernate.cfg.xml.

Parsing error can happen if your xml is invalid, or if it doesnt follow the format (allowed xml declarations) for hibernate.cfg.xml.
 
Souvik Dasgupta
Ranch Hand
Posts: 95
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi Varun,

Please refer to the given Hibernate Mapping:

 
Varun Nayudu
Ranch Hand
Posts: 159
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Souvik Dasgupta wrote:

The DTD definition should go inside quote and also xml encoding is in CAPITAL letters.This should solve the problem.


After changing the code in the cfg.xml file I am still getting the same exception.
My new hibernate.cfg.xml


Error Code
 
Vijitha Kumara
Bartender
Posts: 3908
9
Chrome Fedora Hibernate
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the exact declaration for the hibernate configuration xml as in here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic