-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: connecting hibernate to mysql
PostPosted: Wed Oct 17, 2007 8:05 am 
Newbie

Joined: Tue Oct 16, 2007 1:28 am
Posts: 1
Hibernate version: 3.2.5

Name and version of the database you are using:mysql5.0


Query:

I am sending you the exception thrown while executing the code.
It shows BUILD SUCCESSFUL but no data has got inserted into the table.
Please let me know what changes I have to make in my application.



EXCEPTION :

E:\backup_vb\all_hibernate\hibernate_mysql>ant run -Daction=store
Buildfile: build.xml

clean:
[delete] Deleting directory E:\backup_vb\all_hibernate\hibernate_mysql\bin
[mkdir] Created dir: E:\backup_vb\all_hibernate\hibernate_mysql\bin

copy-resources:
[copy] Copying 3 files to E:\backup_vb\all_hibernate\hibernate_mysql\bin
[copy] Copied 2 empty directories to 1 empty directory under E:\backup_vb\a
ll_hibernate\hibernate_mysql\bin

compile:
[javac] Compiling 3 source files to E:\backup_vb\all_hibernate\hibernate_mys
ql\bin

run:
[java] 17:27:14,813 INFO Environment:514 - Hibernate 3.2.5
[java] 17:27:14,828 INFO Environment:547 - hibernate.properties not found
[java] 17:27:14,828 INFO Environment:681 - Bytecode provider name : cglib
[java] 17:27:14,828 INFO Environment:598 - using JDK 1.4 java.sql.Timestam
p handling
[java] 17:27:14,906 INFO Configuration:1426 - configuring from resource: /
hibernate.cfg.xml
[java] 17:27:14,906 INFO Configuration:1403 - Configuration resource: /hib
ernate.cfg.xml
[java] 17:27:15,171 DEBUG DTDEntityResolver:38 - trying to resolve system-i
d [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
[java] 17:27:15,171 DEBUG DTDEntityResolver:40 - recognized hibernate names
pace; attempting to resolve on classpath under org/hibernate/
[java] 17:27:15,171 DEBUG DTDEntityResolver:50 - located [http://hibernate.
sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
[java] Initial SessionFactory creation failed.org.hibernate.HibernateExcept
ion: Could not parse configuration: /hibernate.cfg.xml
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at util.HibernateUtil.<clinit>(Unknown Source)
[java] at events.EventManager.createAndStoreEvent(Unknown Source)
[java] at events.EventManager.main(Unknown Source)
[java] Caused by: org.hibernate.HibernateException: Could not parse configu
ration: /hibernate.cfg.xml
[java] at org.hibernate.cfg.Configuration.doConfigure(Configuration.jav
a:1494)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:
1428)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:
1414)
[java] ... 3 more
[java] Caused by: org.dom4j.DocumentException: Invalid byte 1 of 1-byte UTF
-8 sequence. Nested exception: Invalid byte 1 of 1-byte UTF-8 sequence.
[java] at org.dom4j.io.SAXReader.read(SAXReader.java:484)
[java] at org.hibernate.cfg.Configuration.doConfigure(Configuration.jav
a:1484)
[java] ... 5 more
[java] Java Result: 1

BUILD SUCCESSFUL
Total time: 2 seconds
E:\backup_vb\all_hibernate\hibernate_mysql>






mysql> use hibernatetest;
Database changed
mysql> select * from events;
Empty set (0.00 sec)

mysql>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.