This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Problem with running my first Hibernate App Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problem with running my first Hibernate App" Watch "Problem with running my first Hibernate App" New topic

Problem with running my first Hibernate App

Varun Nayudu
Ranch Hand

Joined: Jun 26, 2006
Posts: 159
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





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 .

[Thumbnail for Untitled.png]

SCJP 1.5, SCWCD 1.5
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2066

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

Joined: Sep 24, 2009
Posts: 95

Hi Varun,

Please refer to the given Hibernate Mapping:

Thanks and Regards
Varun Nayudu
Ranch Hand

Joined: Jun 26, 2006
Posts: 159
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

Joined: Mar 24, 2008
Posts: 3899

Use the exact declaration for the hibernate configuration xml as in here.

[How to ask questions] [Twitter]
I agree. Here's the link:
subject: Problem with running my first Hibernate App
jQuery in Action, 3rd edition