NHibernate.HibernateException

Test 'Sietech.Wms.Tianma.IntegrationTests.IntegrationTests.ArticleIntegreationTests.SaveArticleTest' failed: Spring.Objects.Factory.ObjectCreationException : Error creating object with name 'NHibernateSessionFactory' defined in 'assembly [Sietech.Wms.Tianma.Dao.NHibernate, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [Sietech.Wms.Tianma.Dao.Dao.xml] line 23' : Initialization of object failed : Could not compile the mapping document: Sietech.Wms.Tianma.Mappings.Article.hbm.xml
  ----> NHibernate.MappingException : Could not compile the mapping document: Sietech.Wms.Tianma.Mappings.Article.hbm.xml
  ----> NHibernate.HibernateException : Could not instantiate dialect class NHibernate.Dialect.OracleDialect
  ----> System.TypeLoadException : Could not load type NHibernate.Dialect.OracleDialect. Possible cause: no assembly name specified.
 在 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure)
 在 Spring.Objects.Factory.Support.AbstractObjectFactory.CreateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments)
 在 Spring.Objects.Factory.Support.AbstractObjectFactory.GetObjectInternal(String name, Type requiredType, Object[] arguments, Boolean suppressConfigure)
 在 Spring.Objects.Factory.Support.AbstractObjectFactory.GetObject(String name)
 在 Spring.Objects.Factory.Support.DefaultListableObjectFactory.GetObjectsOfType(Type type, Boolean includePrototypes, Boolean includeFactoryObjects)
 在 Spring.Objects.Factory.ObjectFactoryUtils.ObjectsOfTypeIncludingAncestors(IListableObjectFactory factory, Type type, Boolean includePrototypes, Boolean includeFactoryObjects)
 在 Spring.Dao.Support.PersistenceExceptionTranslationInterceptor.DetectPersistenceExceptionTranslators(IListableObjectFactory objectFactory)
 在 Spring.Dao.Support.PersistenceExceptionTranslationInterceptor..ctor(IListableObjectFactory objectFactory)
 在 Spring.Dao.Attributes.PersistenceExceptionTranslationAdvisor..ctor(IListableObjectFactory objectFactory, Type repositoryAttributeType)
 在 Spring.Dao.Attributes.PersistenceExceptionTranslationPostProcessor.set_ObjectFactory(IObjectFactory value)
 在 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.ConfigureObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper)
 在 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure)
 在 Spring.Objects.Factory.Support.AbstractObjectFactory.CreateAndCacheSingletonInstance(String objectName, RootObjectDefinition objectDefinition, Object[] arguments)
 在 Spring.Objects.Factory.Support.AbstractObjectFactory.GetObjectInternal(String name, Type requiredType, Object[] arguments, Boolean suppressConfigure)
 在 Spring.Objects.Factory.Support.AbstractObjectFactory.GetObject(String name)
 在 Spring.Objects.Factory.Support.DefaultListableObjectFactory.GetObjectsOfType(Type type, Boolean includePrototypes, Boolean includeFactoryObjects)
 在 Spring.Context.Support.AbstractApplicationContext.GetObjectsOfType(Type type, Boolean includePrototypes, Boolean includeFactoryObjects)
 在 Spring.Context.Support.AbstractApplicationContext.RegisterObjectPostProcessors(IConfigurableListableObjectFactory objectFactory)
 在 Spring.Context.Support.AbstractApplicationContext.Refresh()
 在 Spring.Context.Support.XmlApplicationContext..ctor(Boolean refresh, String name, Boolean caseSensitive, IApplicationContext parentContext, String[] configurationLocations)
 在 Spring.Context.Support.XmlApplicationContext..ctor(String[] configurationLocations)
 在 Spring.Testing.NUnit.AbstractSpringContextTests.LoadContextLocations(String[] locations)
 在 Spring.Testing.NUnit.AbstractDependencyInjectionSpringContextTests.LoadContextLocations(String[] locations)
 在 Spring.Testing.NUnit.AbstractSpringContextTests.GetContext(Object key)
 在 Spring.Testing.NUnit.AbstractDependencyInjectionSpringContextTests.SetUp()
 --MappingException
 在 NHibernate.Cfg.Configuration.LogAndThrow(Exception exception)
 在 NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
 在 NHibernate.Cfg.Configuration.ProcessMappingsQueue()
 在 NHibernate.Cfg.Configuration.AddDocumentThroughQueue(NamedXmlDocument document)
 在 NHibernate.Cfg.Configuration.AddXmlReader(XmlReader hbmReader, String name)
 在 NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name)
 在 NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly)
 在 NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly)
 在 NHibernate.Cfg.Configuration.AddAssembly(String assemblyName)
 在 Spring.Data.NHibernate.LocalSessionFactoryObject.AfterPropertiesSet()
 在 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InvokeInitMethods(Object target, String name, IConfigurableObjectDefinition definition)
 在 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.ConfigureObject(String name, RootObjectDefinition definition, IObjectWrapper wrapper)
 在 Spring.Objects.Factory.Support.AbstractAutowireCapableObjectFactory.InstantiateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching, Boolean suppressConfigure)
 --HibernateException
 在 NHibernate.Dialect.Dialect.InstantiateDialect(String dialectName)
 在 NHibernate.Dialect.Dialect.GetDialect(IDictionary`2 props)
 在 NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
 --TypeLoadException
 在 NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName name, Boolean throwOnError)
 在 NHibernate.Util.ReflectHelper.ClassForName(String name)
 在 NHibernate.Dialect.Dialect.InstantiateDialect(String dialectName)

INFO  Sietech.Wms.Tianma.IntegrationTests.IntegrationTests.ArticleIntegreationTests - Loading config for: assembly://Sietech.Wms.Tianma.Dao.NHibernate/Sietech.Wms.Tianma.Dao/Dao.xml
INFO  Spring.Context.Support.XmlApplicationContext - ApplicationContext Refresh: Completed
INFO  Spring.Data.Common.DbProviderFactory - 37 DbProviders Available. [SqlServer-1.1,SqlServer-2.0,SqlServerCe-3.1,SqlServerCe-3.5.1,OleDb-1.1,OleDb-2.0,OracleClient-2.0,OracleODP-2.0,OracleODP-11-2.0,MySql,MySql-1.0.9,MySql-5.0,MySql-5.0.8.1,MySql-5.1,MySql-5.1.4,MySql-5.2.3,MySql-6.1.3,Npgsql-1.0,Npgsql-2.0-beta1,Npgsql-2.0,DB2-9.0.0-1.1,DB2-9.0.0-2.0,DB2-9.1.0-1.1,DB2-9.1.0.2,iDB2-10.0.0.0,SQLite-1.0.43,SQLite-1.0.44,SQLite-1.0.47,SQLite-1.0.56,SQLite-1.0.65,Firebird-2.1,SybaseAse-12,SybaseAse-15,SybaseAse-AdoNet2,Odbc-1.1,Odbc-2.0,Cache-2.0.0.1]
INFO  NHibernate.Cfg.Environment - NHibernate 2.1.2.4000 (2.1.2.4000)
INFO  NHibernate.Cfg.Environment - hibernate-configuration section not found in application configuration file
INFO  NHibernate.Cfg.Environment - Bytecode provider name : lcg
INFO  NHibernate.Cfg.Environment - Using reflection optimizer
INFO  Spring.Data.NHibernate.LocalSessionFactoryObject - Setting proxy factory to Spring provided one as user did not specify any
INFO  NHibernate.Cfg.Configuration - Searching for mapped documents in assembly: Sietech.Wms.Tianma.Dao.NHibernate
INFO  NHibernate.Cfg.Configuration - Mapping resource: Sietech.Wms.Tianma.Mappings.Article.hbm.xml
WARN  NHibernate.Util.ReflectHelper - Could not load type NHibernate.Dialect.OracleDialect. Possible cause: no assembly name specified.
ERROR NHibernate.Util.ReflectHelper - Could not load type NHibernate.Dialect.OracleDialect.
System.TypeLoadException: Could not load type NHibernate.Dialect.OracleDialect. Possible cause: no assembly name specified.
   在 NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName name, Boolean throwOnError)
ERROR NHibernate.Cfg.Configuration - Could not compile the mapping document: Sietech.Wms.Tianma.Mappings.Article.hbm.xml
NHibernate.MappingException: Could not compile the mapping document: Sietech.Wms.Tianma.Mappings.Article.hbm.xml ---> NHibernate.HibernateException: Could not instantiate dialect class NHibernate.Dialect.OracleDialect ---> System.TypeLoadException: Could not load type NHibernate.Dialect.OracleDialect. Possible cause: no assembly name specified.
   在 NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName name, Boolean throwOnError)
   在 NHibernate.Util.ReflectHelper.ClassForName(String name)
   在 NHibernate.Dialect.Dialect.InstantiateDialect(String dialectName)
   --- 内部异常堆栈跟踪的结尾 ---
   在 NHibernate.Dialect.Dialect.InstantiateDialect(String dialectName)
   在 NHibernate.Dialect.Dialect.GetDialect(IDictionary`2 props)
   在 NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
   --- 内部异常堆栈跟踪的结尾 ---
ERROR Spring.Objects.Factory.Support.DefaultListableObjectFactory -    GetObjectInternal: error obtaining object &NHibernateSessionFactory
ERROR Spring.Objects.Factory.Support.DefaultListableObjectFactory - GetObjectInternal: error obtaining object Spring.Dao.Attributes.PersistenceExceptionTranslationPostProcessor#0

 

配置文件:

 <!-- NHibernate Configuration -->
  <object id="NHibernateSessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate21">
    <property name="DbProvider" ref="DbProvider"/>
    <property name="MappingAssemblies">
      <list>
        <value>Sietech.Wms.Tianma.Dao.NHibernate</value>
      </list>
    </property>
    <property name="HibernateProperties">
      <dictionary>
        <entry key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
        <entry key="dialect" value="NHibernate.Dialect.OracleDialect" />
        <entry key="connection.driver_class" value="NHibernate.Driver.OracleClientDriver"/>
        <entry key="show_sql" value="true"/>
        <entry key="hbm2ddl.auto" value="update"/>
        <entry key="use_outer_join"  value="true" />
      </dictionary>
    </property>

    <!-- provides integation with Spring's declarative transaction management features -->
    <property name="ExposeTransactionAwareSessionFactory" value="true" />


  </object>

将方言改成 NHibernate.Dialect.Oracle10gDialect 搞定

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值