This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Problem with running my first Hibernate App

 
Ranch Hand
Posts: 160
  • 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
[Thumbnail for Untitled.png]
WebApp struture
 
Ranch Hand
Posts: 2102
  • 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.
 
Ranch Hand
Posts: 99
Eclipse IDE Spring Java
  • 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: 160
  • 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
 
Bartender
Posts: 4101
63
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the exact declaration for the hibernate configuration xml as in here.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!