Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with Hibernate test application

 
Eugene Shaforostov
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 ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • 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.
 
Jaikiran Pai
Sheriff
Posts: 10447
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
 
Mathias Nilsson
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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!