NHibernate ISession.Query<T> in Mono/NUnit throwing exception -


i'm attempting first nhibernate project , running in mono/opensuse 11.4. unit tests working under windows when attempt run same tests on mono i'm getting exception when try query object nhibernate session.

saving data through nhibernate seems working correctly.

i'm using mono 2.10.2 , nunit version 2.4.8 fluent nhibernate 1.2 nhibernate 3.1.

i've included full output nunit-console in case:

>nunit version 2.4.8 >copyright (c) 2002-2007 charlie poole. >copyright (c) 2002-2004 james w. newkirk, michael c. two, alexei a. vorontsov. >copyright (c) 2000-2002 philip craig. >all rights reserved. >     >runtime environment - >os version: unix 2.6.37.1 >clr version: 4.0.30319.1 ( 2.10.2 (tarball mon apr 18 15:12:52 utc 2011) ) >     >.f >tests run: 1, failures: 1, not run: 0, time: 1.563 seconds >     >test case failures: >1) mytests.mytest : system.typeinitializationexception : exception thrown type initializer nhibernate.linq.nhrelinqqueryparser >----> system.reflection.reflectiontypeloadexception : classes in module cannot loaded. >at nhibernate.linq.nhlinqexpression.translate (isessionfactoryimplementor sessionfactory) [0x00000] in <filename unknown>:0 >at nhibernate.hql.ast.antlr.astquerytranslatorfactory.createquerytranslators (system.string queryidentifier, iqueryexpression queryexpression, system.string collectionrole, boolean shallow, idictionary`2 filters, isessionfactoryimplementor factory) [0x00000] in <filename unknown>:0 >at nhibernate.engine.query.hqlexpressionqueryplan.createtranslators (system.string expressionstr, iqueryexpression queryexpression, system.string collectionrole, boolean shallow, idictionary`2 enabledfilters, isessionfactoryimplementor factory) [0x00000] in <filename unknown>:0 >at nhibernate.engine.query.hqlexpressionqueryplan..ctor (system.string expressionstr, iqueryexpression queryexpression, system.string collectionrole, boolean shallow, idictionary`2 enabledfilters, isessionfactoryimplementor factory) [0x00000] in <filename unknown>:0 >at nhibernate.engine.query.hqlexpressionqueryplan..ctor (system.string expressionstr, iqueryexpression queryexpression, boolean shallow, idictionary`2 enabledfilters, isessionfactoryimplementor factory) [0x00000] in <filename unknown>:0 >at nhibernate.engine.query.queryplancache.gethqlqueryplan (iqueryexpression queryexpression, boolean shallow, idictionary`2 enabledfilters) [0x00000] in <filename unknown>:0 >at nhibernate.impl.abstractsessionimpl.gethqlqueryplan (iqueryexpression queryexpression, boolean shallow) [0x00000] in <filename unknown>:0 >at nhibernate.impl.abstractsessionimpl.createquery (iqueryexpression queryexpression) [0x00000] in <filename unknown>:0 >at nhibernate.linq.nhqueryprovider.preparequery (system.linq.expressions.expression expression, iquery& query, nhibernate.linq.nhlinqexpression& nhquery) [0x00000] in <filename unknown>:0 >at nhibernate.linq.nhqueryprovider.execute (system.linq.expressions.expression expression) [0x00000] in <filename unknown>:0 >at nhibernate.linq.nhqueryprovider.execute[ienumerable`1] (system.linq.expressions.expression expression) [0x00000] in <filename unknown>:0 >at remotion.data.linq.queryablebase`1[myproject.entities.email].getenumerator () [0x00000] in <filename unknown>:0 >at system.collections.generic.list`1[myproject.entities.email].addenumerable (ienumerable`1 enumerable) [0x00000] in /usr/src/packages/build/mono-2.10.2/mcs/class/corlib/system.collections.generic/list.cs:126 >at system.collections.generic.list`1[myproject.entities.email]..ctor (ienumerable`1 collection) [0x0002f] in /usr/src/packages/build/mono-2.10.2/mcs/class/corlib/system.collections.generic/list.cs:63 >at system.linq.enumerable.tolist[email] (ienumerable`1 source) [0x00006] in /usr/src/packages/build/mono-2.10.2/mcs/class/system.core/system.linq/enumerable.cs:2847 >at mytests.mytest () [0x0000c] in /tmp/source/mytests/mytest.cs:125 >at (wrapper managed-to-native) system.reflection.monomethod:internalinvoke (system.reflection.monomethod,object,object[],system.exception&) >at system.reflection.monomethod.invoke (system.object obj, bindingflags invokeattr, system.reflection.binder binder, system.object[] parameters, system.globalization.cultureinfo culture) [0x000d5] in /usr/src/packages/build/mono-2.10.2/mcs/class/corlib/system.reflection/monomethod.cs:226 >--reflectiontypeloadexception >at (wrapper managed-to-native) system.reflection.assembly:gettypes (system.reflection.assembly,bool) >at system.reflection.assembly.gettypes () [0x00000] in /usr/src/packages/build/mono-2.10.2/mcs/class/corlib/system.reflection/assembly.cs:346 >at remotion.data.linq.parsing.structure.expressiontreeparser.createdefaultnodetypeprovider () [0x00000] in <filename unknown>:0 >at nhibernate.linq.nhibernatenodetypeprovider..ctor () [0x00000] in <filename unknown>:0 >at nhibernate.linq.nhrelinqqueryparser..cctor () [0x00000] in <filename unknown>:0 

following alexcuse's advice ran monodis against dlls. of nhibernate dlls set copylocal. seem happy monodis. nhibernate.dll doesn't however. here end of output:

            class nhibernate.context.wcfstateextension      v_0)     il_0000:  call missing method get_current in assembly 

/tmp/source/mytests/nhibernate.dll, type system.servicemodel.operationcontext [system.servicemodel]system.servicemodel.operationcontext::get_current() il_0005: callvirt missing method get_extensions in assembly /tmp/source/mytests/nhibernate.dll, type system.servicemodel.operationcontext instance <> [system.servicemodel]system.servicemodel.operationcontext::get_extensions() il_000a: callvirt missing method find in assembly /tmp/source/mytests/nhibernate.dll, type typespec 0x1b00017e missing method find in assembly /tmp/source/mytests/nhibernate.dll, type typespec 0x1b00017e * assertion @ get.c:2097, condition `mh' not met

aborted

mono -v

mono jit compiler version 2.10.2 (tarball mon apr 18 15:12:52 utc 2011)  copyright (c) 2002-2011 novell, inc , contributors. www.mono-project.com      tls: __thread      sigsegv: altstack      notifications: epoll      architecture: amd64      disabled: none      misc: debugger softdebug      llvm: yes(2.9svn-mono)      gc: included boehm (with typed gc , parallel mark) 

i gave , installed fluent nhibernate 1.1 nhibernate.linq-2.1.2-ga. seems happy in world of unit tests i'm still trying figure out going wrong current version.

i rolled use nhibernate 2.1.2 additional linq library worked fine revisited other day found fix ridiculously simple.

the mono-wcf package not installed on system. nhibernate 3.2 requires wcf. i've installed it, working perfectly!


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -