Unable to cast object of type 'NHibernate.Caches.SysCache.SysCacheProvider' to type 'NHibernate.Cache.ICacheProvider' - nhibernate

I'm using NHibernate 2.1.2 via Castl ActiveRecord. I wanted to set up second level cache using SysCache. But I got error:
Unable to cast object of type 'NHibernate.Caches.SysCache.SysCacheProvider' to type 'NHibernate.Cache.ICacheProvider'.
How can I correct this?

I'm guessing that you have some assemblies locally in your project and others in the GAC which have a version mismatch as Mauricio is saying. Make sure that NHibernate.Caches.SysCache.dll is in your bin folder (for your website), is the correct version and check that you don't have it in the GAC.

I found the reason. It was a nasty problem from ours. My team have merged all Castle ActiveRecord related assemblies together with ilmerge.exe and suppose named it Company.NHibernate.dll. I have not merged NHibernate.Caches.SysCache.dll with Company.NHibernate.dll. I have just put NHibernate.Caches.SysCache.dll alongside of Company.NHibernate.dll and mentioned name of NHibernate.Caches.SysCache in provider_class.
When I merged NHibernate.Caches.SysCache.dll with Company.NHibernate.dll and mentioned name of Company.NHibernate.dll in provider_class instead, everything went OK.
Thanks all users that tried to help me.

Related

Set the RequestResponseSerializer in ElasticClient

We've seen a resurrection of this issue in a recent update of Elasticsearch (https://github.com/elastic/elasticsearch-net/issues/1937).
We set the SourceSerializer when creating the Client connection but that doesn't seem to help.
Debugging in, I see that RequestResponseSerializer defaults to Nest.InternalSerializer. This JSON serializer has the DateParseHandling field set to DateTime when we want DateTimeOffset. I suspect that this may be the cause of my problem.
Is there a way to set RequestResponseSerializer to verify my theory?
ADDITION: I was able to verify my theory above by altering the NEST code directly. I edited the InternalSerializer::CreateSettings() method to include DateParseHandling = DateParseHandling.DateTimeOffset and that solved the issue.
Now how to set/modify this value for RequestResponseSerializer without modifying NEST code directly...
Turns out my issue was the same as https://github.com/elastic/elasticsearch-net/issues/3164 and seemed to be fixed in v6.2.0 (https://github.com/elastic/elasticsearch-net/pull/3278).
I was running v6.1.0
Upgraded my version to v6.3.1 and all looks well.

Documentum Docbase is unable to save an object

When I using the following API script to save an object,it just hangs up and no result...
link,c,object_id,/temp1/temp2 save,c,object_id
Also I have other test like :
create a new dm_folder object and link to /temp1/temp2, object created.
update dm_folder object to link and unlink, object is linked and unlinked to expected folder paths.
All the above two steps works, but not the ‘save’, why?
Could you guys give me some advice on this issue?
You are mistaking somewhere. API command
link,c,<object_d>,<path_to_link_object_to>
save,c,<object_id>
works as expected, i.e. it links object to specified path which is provided as last argument in first command.
Try formatting better your question so we can identify your syntax errors if there are any.

'RoutePrefixAttribute' is an ambiguous reference between 'System.Web.Http.RoutePrefixAttribute' and 'System.Web.Mvc.RoutePrefixAttribute'

My MVC WebAPI project has been working fine, but suddenly it doesn't compile and I am getting the following error. I am using Attribute routing. I need both the assemblies reference. I've tried
\packages\Microsoft.AspNet.Mvc.4.0.30506.0 and
\packages\Microsoft.AspNet.Mvc.5.2.2
Does anyone know how to fix this?
'RoutePrefixAttribute' is an ambiguous reference between 'System.Web.Http.RoutePrefixAttribute' and 'System.Web.Mvc.RoutePrefixAttribute'
'RouteAttribute' is an ambiguous reference between 'System.Web.Http.RouteAttribute'
and 'System.Web.Mvc.RouteAttribute'
Use full name [System.Web.Mvc.RoutePrefix("smt")]or make alias for reference
using a =System.Web.Http;
using b = System.Web.Mvc;
[a.RoutePrefix("smt")]

Powershell v2 - The correct way to load an assembly as part of a module

I have a Powershell (v2.0) script that I am working on.
One of the first things it does is loads a Module (runMySQLQuery.psm1) which includes (amongst other bits) a function to connect to a MySQL Database.
Import-Module runMySQLQuery.psm1
However, this requires that an assembly MySQL.Data.DLL is loaded in order for this to work.
If I place the line:
[void][system.reflection.Assembly]::LoadFrom("C:\PowerShell\modules\runMySQLQuery\MySql.Data.dll")
at the top of my script (separate to the Import-Module entry), then the whole thing works fine.
But I want to be able to load this assembly at the same time as the module, so that I don't have to worry about forgetting to including the assembly each time I use this module.
I tried placing it at the top of the .psm1 file, but that didn't work.
I then added it to my manifest file as:
RequiredAssemblies = #("C:\PowerShell\modules\runMySQLQuery\MySql.Data.dll")
This also didn't work.
Am I missing something here, is there a proper way to include assemblies as part of a module?
n.b. the error I get when it hasn't loaded properly is:
You cannot call a method on a null-valued expression
Can you just try to assign a varialbe a the beginig of you module :
$dumy = [system.reflection.Assembly]::LoadFrom("C:\PowerShell\modules\runMySQLQuery\MySql.Data.dll")

jackson2.2.0 can not work on android2.2

When using jackson2.2.0 on android2.2(API8), I got this error:
Could not find class java.util.concurrent.ConcurrentNavigableMap, referenced from method com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.<clinit>
I've tested my code on android2.3.3(API10) and android4.0.3(API15), it both works.
Does any one knows how to fix this? Or I have to use another jason parser instead.
This has already been reported on Jackson's issue tracker. A fix is due in 2.2.2 next week or so.