tags:

views:

5663

answers:

4

I am setting up an Oracle connection for Nhibernate for the first time. I have copied the Oracle.DataAccess.dll file into my bin folder. No matter what I try, I keep getting the same error:

Could not load type >NHibernate.Driver.OracleDataClientDriver. Possible cause: no assembly name specified.

I am using the following configuration:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <session-factory name="DefaultSessionFactory">
         <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
         <property name="dialect">NHibernate.Dialect.Oracle9Dialect</property>
         <property name="connection.driver_class">>NHibernate.Driver.OracleDataClientDriver</property>
         <property name="connection.connection_string">Data Source=DB;User ID=USERPassword=****;</property>       
            <property name="show_sql">true</property>

            <mapping assembly="NHibernateExample.DataAccess"/>
        </session-factory>
    </hibernate-configuration>

I have previously only set up NHibernate for SQL Server. Am I missing anything here?

+2  A: 

Did you copy and paste the code? because there's an extra > in there, in the connection.driver_class line

Miki Watts
I feel braindead. I must have been over that config file 20x. Thanks for having a sharp eye. Up and running.
Mark Struzinski
A: 

Once I had similar problem, I fixed adding the "hibernate." in the property names, in your case;

            <property name="hibernate.connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
            <property name="hibernate.dialect">NHibernate.Dialect.Oracle9Dialect</property>
            <property name="hibernate.connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property>
            <property name="hibernate.connection.connection_string">Data Source=DB;User ID=USERPassword=****;</property>

Hope it helps

nmiranda
No the hibernate. was removed from the configuration some time ago. Most samples still include it so you need to delete that sometimes.
Tigraine
A: 

Semi colon seperator missed between user id value and password.

A: 

Excellent step by step tutorial on connecting NHibernate to Oracle: http://nhbwithoracle.blogspot.com/