File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Problem with Hibernate test application 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 Hibernate test application" Watch "Problem with Hibernate test application" New topic
Author

Problem with Hibernate test application

Eugene Shaforostov
Greenhorn

Joined: Aug 11, 2007
Posts: 6
I have a simple test application using Hibernate and MySQL.
I got this error when I was trying to run project:


The project content below files
hibernate.properties


Product.hbm.xml


Product.java


InsertProduct.java


All files be found in one package.

What's wrong?
[ August 12, 2007: Message edited by: Eugene Shaforostov ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

We have a forum for Hibernate questions; Object Relational Mapping (ORM). I'll move this question there as it's sure to get better/faster responses in the appropriate forum.


GenRocket - Experts at Building Test Data
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10290
    
168

Caused by: org.dom4j.DocumentException: Error on line 3 of document : White spaces are required between publicId and systemId. Nested exception: White spaces are required between publicId and systemId.


Your hibernate mapping file looks like:

<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN""http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">


Change this declaration to:



I just added some whitespaces there.


[My Blog] [JavaRanch Journal]
Eugene Shaforostov
Greenhorn

Joined: Aug 11, 2007
Posts: 6
Hi Jaikiran,
Thanks for your reply.
I`m change the declaration like you said, but now I get error while compiling:
Exception in thread "main" org.hibernate.HibernateException: Dialect class not found: net.sf.hibernate.dialect.MySQLDialect
Mathias Nilsson
Ranch Hand

Joined: Aug 21, 2004
Posts: 367
I think this should be



// Mathias


SCJP1.4
Eugene Shaforostov
Greenhorn

Joined: Aug 11, 2007
Posts: 6
Thank you!
Now everything works without any problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with Hibernate test application