Meaningless Drivel is fun!*
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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
Author

Problem with running my first Hibernate App

Varun Nayudu
Ranch Hand

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



[Thumbnail for Untitled.png]



SCJP 1.5, SCWCD 1.5
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2053


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: 77


Hi Varun,

Please refer to the given Hibernate Mapping:



Thanks and Regards, Souvik
SCJP, SCWCD, OCEJWSD
Varun Nayudu
Ranch Hand

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

Joined: Mar 24, 2008
Posts: 3825

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


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Problem with running my first Hibernate App