-->
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: [b]Firebird driver configuration fail[/b]
PostPosted: Thu Aug 02, 2007 3:54 pm 
Newbie

Joined: Sat Jul 21, 2007 2:58 pm
Posts: 3
Location: Mecklenburg-Vorpommern, Germany
Hi,

I want to to configure NHibernate to a Firebird driver, but it fails with:

Code:
NHibernate.HibernateException: Could not create the driver from NHibernate.Driver.FirebirdClientDriver.

at NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary settings) in c:\net\nhibernate\nhibernate\src\NHibernate\Connection\ConnectionProvider.cs:line 114
at NHibernate.Connection.ConnectionProvider.Configure(IDictionary settings) in c:\net\nhibernate\nhibernate\src\NHibernate\Connection\ConnectionProvider.cs:line 65
at NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider(IDictionary settings) in c:\net\nhibernate\nhibernate\src\NHibernate\Connection\ConnectionProviderFactory.cs:line 50
at NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary properties) in c:\net\nhibernate\nhibernate\src\NHibernate\Cfg\SettingsFactory.cs:line 62
at NHibernate.Cfg.Configuration.BuildSettings() in c:\net\nhibernate\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1467
at NHibernate.Cfg.Configuration.BuildSessionFactory() in c:\net\nhibernate\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1039
at NHibernate.Examples.QuickStart.UserFixture.ValidateQuickStart() in userfixture.cs:line 18

System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht.

at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary settings) in c:\net\nhibernate\nhibernate\src\NHibernate\Connection\ConnectionProvider.cs:line 109

NHibernate.HibernateException: The IDbCommand and IDbConnection implementation in the assembly FirebirdSql.Data.FirebirdClient could not be found. Ensure that the assembly FirebirdSql.Data.FirebirdClient 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.

at NHibernate.Driver.ReflectionBasedDriver..ctor(String driverAssemblyName, String connectionTypeName, String commandTypeName) in c:\net\nhibernate\nhibernate\src\NHibernate\Driver\ReflectionBasedDriver.cs:line 26
at NHibernate.Driver.FirebirdClientDriver..ctor() in c:\net\nhibernate\nhibernate\src\NHibernate\Driver\FirebirdClientDriver.cs:line 15


The code is from NHibernate QuickStart Example and is adapted to Firebird. I use the Net 1.1 Data Provider Version 1.7.1. Copied the installed Dll FirebirdSql.Data.Firebird.dll to the output directory of the Net 1.1 Project, referenced that in the project too. Adapted hibernate.cfg.xml and app.config like described in http://www.hibernate.org/361.html#A5. The original app.config contains a <nhibernate> section, that I uncommented, because of using the configuration of *.cfg.xml file. The code of UserFixture.cs I changed a bit too:

Code:
Configuration cfg = new Configuration().Configure();
//         cfg.AddAssembly("NHibernate.Examples");


The configuration is read but the driver could not be initiated. But I don't know why. Could anybody help ?

Thanks in forward
Rico


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 03, 2007 3:16 am 
Regular
Regular

Joined: Thu Nov 23, 2006 10:29 am
Posts: 106
Location: Belgium
Hi,

Just a hunch: note that NHibernate has 2 Firebird drivers:
- FirebirdDriver
- FirebirdClientDriver

One of both is for version 2 of Firebird, the other is for a previous version of Firebird (I don't know for sure which one is for which version).

I suggest you try using the other driver and see if that fixes your problem.

_________________
Please rate this post if it helped.

X.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 03, 2007 3:53 am 
Newbie

Joined: Sat Jul 21, 2007 2:58 pm
Posts: 3
Location: Mecklenburg-Vorpommern, Germany
Thanks for your answer ...

It has something to do with the driver dll which I bind to my project, but what, hmmm...

What's unclear to me, is that the suggestion of NHibernate say this...

Code:
<runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <qualifyAssembly partilaName="FirebirdSql.Data.FirebirdClient" fullName="FirebirdSql.Data.FirebirdClient, Version=2.0.1.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c">
         </qualifyAssembly>
      </assemblyBinding>
</runtime>


After Firebird Net Data Provider installation the GAC contains:

Code:
FirebirdSql.Data.Firebird, Version=1.7.1.0, Culture=neutral, PublicKeyToken=fa843d180294369d, Custom=null


So the dll in the instalation path of that is FirebirdSql.Data.Firebird.dll and not FirebirdSql.Data.FirebirdClient.dll. I think the documentation mentioned above is for a different driver version. But how can I work with Net 1.1 data provider. I need that and not that for Net 2.

One idea was that I adapted the <runtime> part in the config to the registered Firebird version like:

Code:
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <qualifyAssembly partilaName="FirebirdSql.Data.Firebird" fullName="FirebirdSql.Data.Firebird, Version=1.7.1.0, Culture=neutral, PublicKeyToken=fa843d180294369d">
         </qualifyAssembly>
      </assemblyBinding>
   </runtime>



But it doesn't work .... Of what avail is it, when a Net 1.1 driver exist, but it can't be used ?

Rico


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 03, 2007 4:03 am 
Regular
Regular

Joined: Thu Nov 23, 2006 10:29 am
Posts: 106
Location: Belgium
Hi,

What I am saying is: in your configuration file, I think you are using:

Code:
<property name="connection.driver_class">NHibernate.Driver.FirebirdClientDriver</property>


while I think you should be using:

Code:
<property name="connection.driver_class">NHibernate.Driver.FirebirdDriver</property>


FirebirdClientDriver = Firebird 2
FirebirdDriver = Firebird < 2

_________________
Please rate this post if it helped.

X.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 03, 2007 4:09 am 
Newbie

Joined: Sat Jul 21, 2007 2:58 pm
Posts: 3
Location: Mecklenburg-Vorpommern, Germany
Thanks,

that works now, hrrr, that was a heavy birth ;-)


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.