• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Problem with Hibernate test application

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Eugene Shaforostov
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this should be



// Mathias
 
Eugene Shaforostov
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you!
Now everything works without any problem.
 
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!