title: Could not create the driver from NHibernate.Driver.OracleDataClientDriver
body: <p>Here's the code raising the exception:</p>
  
  <pre><code>public static class NHibernateSessionManager
  {
      private static ISessionFactory sessionFactory = new Configuration().Configure().BuildSessionFactory();
  
      public static ISession GetSession(string clientId)
      {
          if (ContextSession == null)
              ContextSession = sessionFactory.OpenSession(new OracleIntercerptor(clientId.ToUpper()));
          else
              ((OracleConnection)ContextSession.Connection).ClientId = clientId;
  
          return ContextSession;
      }
  
      // - snip -
  }
  </code></pre>
  
  <p>and the call to the code where the exception is raised:</p>
  
  <pre><code>    private ISession NHibernateSession
      {
          get 
          {
              return NHibernateSessionManager.GetSession(SessionWrapper.GetUser());
          }
      }
  </code></pre>
  
  <p>I get a <code>TypeInitializationException</code> </p>
  
  <blockquote>
    <p>{"The type initializer for
    'Sigaf.Presupuesto.EntidadesDAL.NHibernate.NHibernateSessionManager'
    threw an exception."}</p>
  </blockquote>
  
  <p>With an inner exception of</p>
  
  <blockquote>
    <p>{"Could not create the driver from
    NHibernate.Driver.OracleDataClientDriver."}</p>
  </blockquote>
  
  <p>A few more inner exceptions lead me to a NRE:</p>
  
  <blockquote>
    <p>Object reference not set to an
    instance of an object.<br>
       at
    NHibernate.Driver.OracleDataClientDriver..ctor()</p>
  </blockquote>
  
  <p>NHibernate v3.0
  Target Framework v4.0
  This code implementation is working for other, similar, solutions.</p>
  
  <p>Oh, the Hibernate.config file:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"&gt;
    &lt;session-factory&gt;
      &lt;property name="connection.provider"&gt;NHibernate.Connection.DriverConnectionProvider&lt;/property&gt;
      &lt;property name="dialect"&gt;NHibernate.Dialect.Oracle10gDialect&lt;/property&gt;
      &lt;property name="current_session_context_class"&gt;web&lt;/property&gt;
      &lt;property name="proxyfactory.factory_class"&gt;NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu&lt;/property&gt;
      &lt;property name="connection.driver_class"&gt;NHibernate.Driver.OracleDataClientDriver&lt;/property&gt;
      &lt;property name="connection.connection_string_name"&gt;Sigaf&lt;/property&gt;
      &lt;property name="default_schema"&gt;PRE&lt;/property&gt;
      &lt;property name="show_sql"&gt;true&lt;/property&gt;
      &lt;mapping assembly="Sigaf.Presupuesto.EntidadesDAL" /&gt;
    &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>