-->
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.  [ 5 posts ] 
Author Message
 Post subject: Could not create the driver from NHibernate.Driver.MySqlData
PostPosted: Sat Jan 19, 2008 7:45 am 
Newbie

Joined: Wed Jan 09, 2008 9:17 am
Posts: 4
Hi All,

I am using NHibernate 1.2 and MySQL Driver 5.1

I had done MS SQL Server +NHibernate integration successfully.


Now,I am trying to integrate NHibernate with MYSql. I have followed all the steps still i am getting

"Could not create the driver from NHibernate.Driver.MySqlDataDriver."

My Hibernate.cfg.xml is below.

<?xml version='1.0' encoding='utf-8'?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">

<!-- an ISessionFactory instance -->
<session-factory>

<!-- properties -->
<property name="dialect">NHibernate.Dialect.MySQLDialect</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>
<property name="connection.connection_string">Server=localhost;Database=database;User ID=username;Password=paswd;CharSet=win1250;</property>
<property name="show_sql">true</property>

<!-- mapping files -->
<mapping assembly="DB.Library" />

</session-factory>

</hibernate-configuration>


I have followed this link for NHibernate integration for MySql.

http://geekswithblogs.net/pariam/archiv ... 86352.aspx

stack trace :

at NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary settings)
at NHibernate.Connection.ConnectionProvider.Configure(IDictionary settings)
at NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider(IDictionary settings)
at NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary properties)
at NHibernate.Cfg.Configuration.BuildSettings()
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at com.resecon.video.db.NHibernateHelper..cctor() in 17


Regards,
Jigar[/b]


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 19, 2008 11:59 am 
Regular
Regular

Joined: Tue Dec 25, 2007 3:41 pm
Posts: 57
Location: Argentina
Hi,

That it's the unique error that you get ? You can provide all inner exceptions ?


Top
 Profile  
 
 Post subject: Could not create the driver from NHibernate.Driver.MySqlData
PostPosted: Mon Jan 21, 2008 12:06 am 
Newbie

Joined: Wed Jan 09, 2008 9:17 am
Posts: 4
Below is the innerException.


InnerException :

{"Exception has been thrown by the target of an invocation."}

{"The IDbCommand and IDbConnection implementation in the assembly MySql.Data could not be found. Ensure that the assembly MySql.Data is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly."}

stacktrace :


" at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)\r\n at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)\r\n at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)\r\n at System.Activator.CreateInstance(Type type, Boolean nonPublic)\r\n at System.Activator.CreateInstance(Type type)\r\n at NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary settings)"

Regards,
Jigar


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 21, 2008 7:13 am 
Regular
Regular

Joined: Tue Dec 25, 2007 3:41 pm
Posts: 57
Location: Argentina
Make shure that you have at the output directory the assembly MySql.Data.dll.
You can download here:
http://dev.mysql.com/downloads/connector/net/


Top
 Profile  
 
 Post subject: Re: Could not create the driver from NHibernate.Driver.MySqlData
PostPosted: Wed Jan 26, 2011 4:35 am 
Newbie

Joined: Wed Jan 26, 2011 4:30 am
Posts: 1
and if u already have MySql.Data.dll. Just go to your project references and select MySql.Data.dll, then go to the properties window and change the 'Copy Local' property to True.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.