-->
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.  [ 3 posts ] 
Author Message
 Post subject: Doctype correct?
PostPosted: Tue Apr 23, 2013 4:24 am 
Newbie

Joined: Tue Apr 23, 2013 4:13 am
Posts: 2
Hello!

I'm trying to do and exemple of this site: http://www.compilr.org/struts-2-and-hibernate-4-application/1343/

But when i execute the aplicacion I can see this error on the Eclipse console: Initial SessionFactory creation failed.org.hibernate.service.classloading.spi.ClassLoadingException: Specified JDBC Driver com.mysql.jdbc.Driver class not found

But the code I think that is correct, is the next:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
   <session-factory>
      <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
      <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
      <property name="hibernate.connection.url">jdbc:mysql://localhost/test</property>
      <property name="hibernate.connection.username">root</property>
      <property name="hibernate.connection.password">root</property>
      <mapping resource="entity/Login.hbm.xml"/>
   </session-factory>
</hibernate-configuration>


Could any give me a hand?

Thanks from Barcelona - Spain


Top
 Profile  
 
 Post subject: Re: Doctype correct?
PostPosted: Tue Apr 23, 2013 4:45 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
you need to include the MySQL JDBC driver on your classpath: Hibernate connects using it but it's not included.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Doctype correct?
PostPosted: Tue Apr 23, 2013 5:17 am 
Newbie

Joined: Tue Apr 23, 2013 4:13 am
Posts: 2
Hello,

I did and now my classpath is this:
CLASSPATH=D:\uoc\workspace\BibliotecaTADs_cat\dist\tads.jar;D:\uoc\TFC\software\mysql-connector-java-5.1.24\mysql-connector-java-5.1.24-bin.jar;.

Also the this .jar file is added inside of the project as you can see on the Project structure image:
Image

But the error continue.


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

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.