Akka.Net Persistence with MongoDB - akka.net

I'm trying to implement Akka Persistence using Mongodb and I am getting an error that says
"Method 'DeleteAsync' in type
'Akka.Persistence.MongoDb.Snapshot.MongoDbSnapshotStore' from assembly
'Akka.Persistence.MongoDb, Version=1.0.4.1, Culture=neutral,
PublicKeyToken=null' does not have an implementation"
Here is my configuration:
var config = ConfigurationFactory.ParseString(#"
akka {
persistence {
publish-plugin-commands = on
snapshot-store {
plugin = ""akka.persistence.snapshot-store.mongodb""
mongodb {
class = ""Akka.Persistence.MongoDb.Snapshot.MongoDbSnapshotStore, Akka.Persistence.MongoDb""
connection-string = ""mongodb://user:pass#paulo.mongohq.com:10083/DbName""
collection = ""AkkaSnapshotStore""
}
}
journal {
plugin = ""akka.persistence.journal.mongodb""
mongodb {
class = ""Akka.Persistence.MongoDb.Journal.MongoDbJournal, Akka.Persistence.MongoDb""
connection-string = ""mongodb://user:pass#paulo.mongohq.com:10083/DbName""
collection = ""AkkaEventJournal""
}
}
}
}");
I think i have created an actor system correctly:
https://gist.github.com/amarwadi/a887b26e14b0d42191b7
and am sending a message to a Persistent Actor and I keep getting the following message infinitely
[ERROR][1/2/2016 2:36:36 AM][Thread 0011][akka://example123/user/section-actor] Method 'DeleteAsync' in type 'Akka.Persistence.MongoDb.Snapshot.MongoDbSnapshotStore' from assembly 'Akka.Persistence.MongoDb, Version=1.0.4.1, Culture=neutral, PublicKeyToken=null' does not have an implementation.
Cause: System.TypeLoadException: Method 'DeleteAsync' in type 'Akka.Persistence.MongoDb.Snapshot.MongoDbSnapshotStore' from assembly 'Akka.Persistence.MongoDb, Version=1.0.4.1, Culture=neutral, PublicKeyToken=null' does not have an implementation.
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at Akka.Persistence.PersistenceExtension.CreatePlugin(String configPath, Func2 dispatcherSelector) at Akka.Persistence.PersistenceExtension.<>c__DisplayClass13_0.<SnapshotStoreFor>b__0() at System.Lazy1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
at System.Lazy`1.get_Value()
at Akka.Persistence.PersistenceExtension.SnapshotStoreFor(String snapshotPluginId)
at Akka.Persistence.Eventsourced.get_SnapshotStore()
at Akka.Persistence.Eventsourced.LoadSnapshot(String persistenceId, SnapshotSelectionCriteria criteria, Int64 toSequenceNr)
at Akka.Persistence.Eventsourced.b__76_0(Receive receive, Object message)
at Akka.Persistence.Eventsourced.AroundReceive(Receive receive, Object message)
at Akka.Actor.ActorCell.ReceiveMessage(Object message)
at Akka.Actor.ActorCell.Invoke(Envelope envelope)

Per an update from the developers of Akka.NET Persistence on MongoDB, this was broken in persistence in mongo with the introduction of 1.0.5. It will be corrected shortly.
https://github.com/akkadotnet/Akka.Persistence.MongoDB/issues/12

Related

Visual Studio 2013 designer trying to load wrong version of project DLL

I have a visual studio project in a solution that references a class library project from the same solution. The project compiles and executes just fine. However, when I try to open one form in the designer I get a message:
Could not load file or assembly 'MyLibName, Version=1.0.5477.26907, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
However, the current version of the DLL is: 1.0.5510.41110
Why is the designer trying to look for an old version? How can I open my form in the designer?
I've tried removing this library from all the projects that reference it in my project and re-adding it. And, of course, I've tried cleaning and rebuilding the project from scratch. Any help appreciated.
Here's the stack trace:
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at System.UnitySerializationHolder.GetRealObject(StreamingContext context)
at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
at System.Resources.ResXDataNode.GenerateObjectFromDataNodeInfo(DataNodeInfo dataNodeInfo, ITypeResolutionService typeResolver)
at System.Resources.ResXDataNode.GetValue(ITypeResolutionService typeResolver)
at System.Resources.ResXResourceReader.ParseDataNode(XmlTextReader reader, Boolean isMetaData)
at System.Resources.ResXResourceReader.ParseXml(XmlTextReader reader)
Finally got it--seems I'd accidentally serialized an instantiation of an object from the older library version in a user control's public property on this form.
To resolve the issue:
1) I manually edited the .resx file in notepad and removed the base64 encoded binary data for the accidentally serialized property.
2) I followed the directions here to prevent my property from being serialized in the future, ie. I added this attribute:
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

Spring.Net Placeholder exception

I have the weirdest problem with Spring.net, when trying to convert my project from .NET 3.5 to .NET 4.
Let me summarise our architecture:
Project A (not under my control) has a Sprint.Net config referencing a setting (configurationProvider.url) like this:
<constructor-arg name="Url" value="${configurationProvider.url}" />
Project B (my project, under my control) has another config file with the value of this setting:
<configuration>
<Environment>
<add key="Dashboard.Environment" value="UAT" />
<add key="configurationProvider.url" value="http://something/ConfigurationProvider.asmx"/>
<add key="pkicheck.url" value="http://something/webservices/pkicheck.asmx"/>
<add key="sso.url" value="http://something/webservices/ssoclient.asmx"/>
</Environment>
</configuration>
It all works very well when Project B was .NET 3.5.
When converting this project to .NET 4 (and that's the only change), the whole thing starts failing, and it's giving me this exception:
Could not resolve placeholder 'configurationProvider.url'
It is obviously not finding the configuration setting on the ProjectB configuration file, although this file is there and contains the value.
What could have changed between 3.5 and 4?
Full exception:
<ConfigurationErrorsException d1p1:type="ConfigurationErrorsException">
<ClassName>System.Configuration.ConfigurationErrorsException</ClassName>
<Message>Error creating context 'spring.root': Error registering object with name 'configurationProvider' defined in 'assembly [ProjectA.Core, Version=0.0.0.88, Culture=neutral, PublicKeyToken=1b28b51fb20f454e], resource [ProjectA.Core.Framework.config] line 111' : Could not resolve placeholder 'configurationProvider.url'.</Message>
<Data d1p1:type="IDictionary"/>
<InnerException d1p1:type="Exception">
<ClassName>Spring.Objects.Factory.ObjectDefinitionStoreException</ClassName>
<Message>Error registering object with name 'configurationProvider' defined in 'assembly [ProjectA.Core, Version=0.0.0.88, Culture=neutral, PublicKeyToken=1b28b51fb20f454e], resource [ProjectA.Core.Framework.config] line 111' : Could not resolve placeholder 'configurationProvider.url'.</Message>
<Data d1p1:type="IDictionary"/>
<InnerException d1p1:type="Exception"/>
<HelpURL/>
<StackTraceString> at Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer.ProcessProperties(IConfigurableListableObjectFactory factory, NameValueCollection props) at Spring.Objects.Factory.Config.PropertyResourceConfigurer.PostProcessObjectFactory(IConfigurableListableObjectFactory factory) at Spring.Context.Support.AbstractApplicationContext.ProcessObjectFactoryPostProcessors(IList objectFactoryPostProcessors) at Spring.Context.Support.AbstractApplicationContext.InvokeObjectFactoryPostProcessors() at Spring.Context.Support.AbstractApplicationContext.Refresh() at Spring.Context.Support.XmlApplicationContext..ctor(Boolean refresh, String name, Boolean caseSensitive, IApplicationContext parentContext, String[] configurationLocations) at Spring.Context.Support.XmlApplicationContext..ctor(String name, Boolean caseSensitive, String[] configurationLocations) at _dynamic_Spring.Context.Support.XmlApplicationContext..ctor(Object[] ) at Spring.Reflection.Dynamic.SafeConstructor.Invoke(Object[] arguments) at Spring.Context.Support.ContextHandler.RootContextInstantiator.InvokeContextConstructor(ConstructorInfo ctor) at Spring.Context.Support.ContextHandler.ContextInstantiator.InstantiateContext() at Spring.Context.Support.ContextHandler.InstantiateContext(IApplicationContext parentContext, Object configContext, String contextName, Type contextType, Boolean caseSensitive, String[] resources) at Spring.Context.Support.ContextHandler.Create(Object parent, Object configContext, XmlNode section)</StackTraceString>
<RemoteStackTraceString/>
<RemoteStackIndex>0</RemoteStackIndex>
<ExceptionMethod>8 ProcessProperties Spring.Core, Version=1.3.0.20349, Culture=neutral, PublicKeyToken=65e474d141e25e07 Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer Void ProcessProperties(Spring.Objects.Factory.Config.IConfigurableListableObjectFactory, System.Collections.Specialized.NameValueCollection)</ExceptionMethod>
<HResult>-2146232832</HResult>
<Source>Spring.Core</Source>
<WatsonBuckets d1p1:type="System.Byte"d1p1:includeArrayAttribute="true"/>
<_resourceDescription>assembly [ProjectA.Core, Version=0.0.0.88, Culture=neutral, PublicKeyToken=1b28b51fb20f454e], resource [ProjectA.Core.Framework.config] line 111</_resourceDescription>
<_objectName>configurationProvider</_objectName>
</InnerException>
<HelpURL/>
<StackTraceString> at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult) at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSection(String configKey) at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName) at System.Configuration.ConfigurationManager.GetSection(String sectionName) at Spring.Util.ConfigurationUtils.GetSection(String sectionName) at Spring.Context.Support.ContextRegistry.InitializeContextIfNeeded() at Spring.Context.Support.ContextRegistry.GetContext() at ProjectA.Core.Controller.Initialise(String flavour) in d:\TeamCity8100\buildAgent\work\850180d7b576030f\Code\Src\ProjectA\Framework\Core\Controller.cs:line 238</StackTraceString>
<RemoteStackTraceString/>
<RemoteStackIndex>0</RemoteStackIndex>
<ExceptionMethod>8 EvaluateOne System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a System.Configuration.BaseConfigurationRecord System.Object EvaluateOne(System.String[], System.Configuration.SectionInput, Boolean, System.Configuration.FactoryRecord, System.Configuration.SectionRecord, System.Object)</ExceptionMethod>
<HResult>-2146232062</HResult>
<Source>System.Configuration</Source>
<WatsonBuckets d1p1:type="System.Byte"d1p1:includeArrayAttribute="true"/>
<filename d1p1:type="Object"/>
<line>0</line>
<firstFilename d1p1:type="Object"/>
<firstLine>0</firstLine>
<count>0</count>
</ConfigurationErrorsException>
I eventually found the problem.
We use PropertyPlaceholderConfigurer in our config, and we never set an "Order" property. So Spring was "ordering" on Order, but since Order was always equal to int.Max, the order output was non-deterministic.
Adding Order to the config file fixed it.

CannotCreateCustomizationDomainException: Customization could not be loaded because the application domain could not be created

I'm trying to run an Excel 2007 VSTO 3.0 addin we've created. However since installing the ION Trading MarketView Excel Plug-in our add-in no longer seems to load properly and fails with the following error:
Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: Customization could not be loaded because the application domain could not be created. ---> System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName)
at System.AppDomain.CreateInstance(String assemblyName, String typeName)
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)
at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.LoadMafPipeline(AppDomain newDomain, IntPtr hostServiceProvider, AddInInformation info, EntryPoints requestedEntryPoints, OfficeApp officeApplication, OfficeVersion officeVersion, IntPtr& executor)
at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)
--- End of inner exception stack trace ---
Does anyone have any idea what could be causing this? Any pointers for how I could investigate further?
Thanks,
Tom
Here are some tips you may find on web, in order to fix the problem:
Reinstall VSTOR
Disable other add-ins
Install framework 3.5 sp1
Fix error in the security configuration on the computer that is running the Visual Studio Tools for Office solution
Modify/Disable custom rule of a company's virus software, blocking the .net framework ability to create the 'shadow copy' version of the vsto .dll.
Turn on .NET programmability support http://sqlblog.com/blogs/davide_mauri/archive/2010/07/30/powerpivot-not-visibile-in-excel.aspx
Move the entire solution to .NET 4.0

NHibernate + Remoting = ReflectionPermission Exception

We are dealing with a problem when using NHibernate with Remoting in a machine with full trust enviroment (actually that's our dev machine).
The problem happens when whe try to send as a parameter an object previously retrieved from the server, that contains a NHibernate Proxy in one of the properties (a lazy one).
As we are in the dev machine, there's no restriction in the trust level of the web app (it's set to Full) and, as a plus, we've configured NHibernate's and Castle's assemblies to full trust in CAS (even thinking that it'd not be necessary as the remoting app in IIS has the full trust level).
Does anyone have any idea of what can be causing this exception? Stack trace below.
InnerException: System.Security.SecurityException
Message="Falha na solicitação da permissão de tipo 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'."
Source="mscorlib"
GrantedSet=""
PermissionState="<IPermission class=\"System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\"\r\nversion=\"1\"\r\nFlags=\"ReflectionEmit\"/>\r\n"
RefusedSet=""
Url=""
StackTrace:
em System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
em System.Security.CodeAccessPermission.Demand()
em System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternalNoLock(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark)
em System.Reflection.Emit.AssemblyBuilder.DefineDynamicModuleInternal(String name, Boolean emitSymbolInfo, StackCrawlMark& stackMark)
em System.Reflection.Emit.AssemblyBuilder.DefineDynamicModule(String name, Boolean emitSymbolInfo)
em Castle.DynamicProxy.ModuleScope.CreateModule(Boolean signStrongName)
em Castle.DynamicProxy.ModuleScope.ObtainDynamicModuleWithWeakName()
em Castle.DynamicProxy.ModuleScope.ObtainDynamicModule(Boolean isStrongNamed)
em Castle.DynamicProxy.Generators.Emitters.ClassEmitter.CreateTypeBuilder(ModuleScope modulescope, String name, Type baseType, Type[] interfaces, TypeAttributes flags, Boolean forceUnsigned)
em Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope modulescope, String name, Type baseType, Type[] interfaces, TypeAttributes flags, Boolean forceUnsigned)
em Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope modulescope, String name, Type baseType, Type[] interfaces, TypeAttributes flags)
em Castle.DynamicProxy.Generators.Emitters.ClassEmitter..ctor(ModuleScope modulescope, String name, Type baseType, Type[] interfaces)
em Castle.DynamicProxy.Generators.BaseProxyGenerator.BuildClassEmitter(String typeName, Type parentType, Type[] interfaces)
em Castle.DynamicProxy.Generators.BaseProxyGenerator.BuildClassEmitter(String typeName, Type parentType, IList interfaceList)
em Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] interfaces, ProxyGenerationOptions options)
em Castle.DynamicProxy.Serialization.ProxyObjectReference.RecreateClassProxy()
em Castle.DynamicProxy.Serialization.ProxyObjectReference.RecreateProxy()
em Castle.DynamicProxy.Serialization.ProxyObjectReference..ctor(SerializationInfo info, StreamingContext context)
Thank you in advance.
Actually, I work with Pedro, we found the problem: the serializer of the Remoting Service has to be explicit configured to allow full trust calls in the server side.
Something like (configuration file):
<channels>
<channel ref="http">
<serverProviders>
<provider ref="wsdl" />
<formatter ref="soap" typeFilterLevel=Low />
<formatter ref="binary" typeFilterLevel=Low />
</serverProviders>
</channel>
</channels>
Or (programatically):
BinaryServerFormatterSinkProvider provider = new BinaryServerFormatterSinkProvider();
provider.TypeFilterLevel = TypeFilterLevel.Full;
Hope this helps anyone else.
Regards.

How to configure NHibernate class mapping from IronPython?

I try to use NHibernate from IronPython. I have copied the NHibernate dependencies to my C:\Users\shamel\python\HelloPy\libs directory.
I have this IronPython code:
import sys
sys.path.append("C:\Users\shamel\python\HelloPy\libs")
import clr
clr.AddReference("NHibernate")
clr.AddReference("LinFu.DynamicProxy")
clr.AddReference("NHibernate.ByteCode.LinFu")
from Entities.Entity import Customer
from NHibernate.Cfg import Configuration
configuration = Configuration();
configuration.Configure("PocoLib.cfg.xml");
configuration.AddXmlFile("Customer.hbm.xml");
factory = configuration.BuildSessionFactory();
My entity classes are defined in Entity.py in the Entity package. That explains the from Entities.Entity import Customer.
Here is what my Customer.hbm.xml file look like
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="Entities"
namespace="Entities">
<class name="Customer" lazy="false">
...
</class>
The program fails on the configuration.AddXmlFile("Customer.hbm.xml"); line:
configuration.AddXmlFile("Customer.hbm.xml");
StandardError: Could not compile the mapping document: Customer.hbm.xml
ERROR: Module: nhtests could not be imported.
I suppose NHibernate is not able to resolve the assembly and namespace specified in the hibernate-mapping header. (The problem is not that the xml file is not found; I tried with a name that does not exist and I get a different error)
Any help will be greatly appreciated.
Sly
EDIT: 27 Dec 2009: Here is the stack trace. I think it confirms that NHibernate is not able to find my types.
*** Outer ***
MappingException
persistent class Entities.Customer, Entities not found
at Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.CallWithInstance(Object[] args, Boolean& shouldOptimize)
at IronPython.Runtime.Types.BuiltinFunction.BuiltinMethodCaller`2.Call1(CallSite site, CodeContext context, TFuncType func, T0 arg0)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Microsoft.Scripting.Utils.InvokeHelper`6.Invoke(Object arg0, Object arg1, Object arg2, Object arg3, Object arg4)
at Microsoft.Scripting.Utils.ReflectedCaller.Invoke(Object[] args)
at Microsoft.Scripting.Interpreter.CallInstruction.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
*** Inner ***
MappingException
persistent class Entities.Customer, Entities not found
at NHibernate.Cfg.XmlHbmBinding.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
at NHibernate.Cfg.XmlHbmBinding.ClassBinder.BindClass(XmlNode node, IDecoratable classMapping, PersistentClass model, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.RootClassBinder.Bind(XmlNode node, HbmClass classSchema, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.AddRootClasses(XmlNode parentNode, IDictionary`2 inheritedMetas)
at NHibernate.Cfg.XmlHbmBinding.MappingRootBinder.Bind(XmlNode node)
at NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)
*** Inner Inner ***
FileNotFoundException
Could not load file or assembly 'Entities' or one of its dependencies. The system cannot find the file specified.
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at NHibernate.Util.ReflectHelper.TypeFromAssembly(AssemblyQualifiedTypeName name, Boolean throwOnError)
at NHibernate.Util.ReflectHelper.ClassForName(String name)
at NHibernate.Cfg.XmlHbmBinding.Binder.ClassForFullNameChecked(String fullName, String errorMessage)
EDIT 29 Dec 2009 :
Even after I solve the namespace/assembly name issue, I don't think Nhibernate will be able to save/load my Python entities. As far as a now understand, when a Python instance is passed to a statically typed library (such as NHibernate), that library does not see its members. So Nhibernate will not find any property on my type because those properties are not visible to statically typed libraries. In order for this to work, NHibernate would have to support DLR integration, possibly using the C# 4.0 Dynamic keyword. To be continued...
It is not possible to use NHibernate from IronPython on entities defines in IronPython.