permaculture playing cards*
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 Android Security Essentials Live Lessons this week in the Android 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: 2049


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

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


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with running my first Hibernate App
 
Similar Threads
NullPointerException on SessionFactory sessionFactory = new Configuration().configure().buildSession
Cannot insert record into Database!
glassfish vs. Hibernate: JNDI configuration
Beginner in hibernate getting error : org.hibernate.MappingException: Unknown entity
Accessing hibernate.cfg.xml from web project through JAR file