Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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.
 
A berm makes a great wind break. And we all like to break wind once in a while. Like this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic