マッピングが機能していることを証明するための簡単な統合サニティ テストを取得しました。当初は MSQL データベース サーバーを使用していましたが、現在は MySQL のサポートを追加しています (または、少なくともサポートしていると思っていました)。 nhibernate.cfg.xml ファイルをロードします。
セットアップ: System.ArgumentNullException: 値を null にすることはできません。
パラメータ名:ストリーム
設定ファイルは次のとおりです。
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<!-- Connection config -->
<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MySQLDialect</property>
<property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>
<property name="connection.connection_string">Server=localhost;Database=xxxxx;User ID=root;</property>
<property name="show_sql">true</property>
<!-- Mapping config -->
<mapping assembly="xxxxx.xxxxx"/>
</session-factory>
</hibernate-configuration>
インターウェブには、これが MySQL コネクタの問題であるという情報があるようですが、6.1 より前のバージョンでのみ、解決策は見つかりませんでした。人々が更新するように言っているだけです。ただし、最新バージョンを使用しています。どんな助けでも素晴らしいでしょう!
** 編集 **
根本的な問題の診断に役立つ場合のスタック トレースを次に示します。
at System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
at System.IO.StreamReader..ctor(Stream stream)
at MySql.Data.MySqlClient.SchemaProvider.GetReservedWords()
at MySql.Data.MySqlClient.SchemaProvider.GetSchemaInternal(String collection, String[] restrictions)
at MySql.Data.MySqlClient.ISSchemaProvider.GetSchemaInternal(String collection, String[] restrictions)
at MySql.Data.MySqlClient.SchemaProvider.GetSchema(String collection, String[] restrictions)
at MySql.Data.MySqlClient.MySqlConnection.GetSchema(String collectionName, String[] restrictionValues)
at MySql.Data.MySqlClient.MySqlConnection.GetSchema(String collectionName)
at NHibernate.Dialect.Schema.AbstractDataBaseSchema.GetReservedWords()
at NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords(Dialect dialect, IConnectionHelper connectionHelper)
at NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.Update(ISessionFactory sessionFactory)
at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings, EventListeners listeners)
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at xxxxx.unittests.logic.mappings.MappingSanityTests.PreTestSetup() in C:\Documents and Settings\xxxxx\My Documents\Projects\Other\xxxxx\src\tests\xxxxx.integrationtests\logic\mappings\MappingSanityTests.cs:line 22