What is the cause of FluentValidation Method Not Found exception? - exception

I've got a Domain Driven Design solution and for some reason, I'm getting this exception at RunTime when the API call is made through GateWay:
One or more errors occurred. (Method not found: 'Void FluentValidation.AbstractValidator`1.When(System.Func`2<!0,Boolean>, System.Action)'.)
The error occurs as below:
I have solution like this:
The main 4 project I'm focusing on right now are:
Core.Model
Account.Api
Service.Api.Gateway
Web.ClientSite
Web.ClientSite makes request to Service.Api.Gateway which then calls Account.Api.
Note that Core.Model is referenced everywhere
VERY IMPORTANT: If I remove the reference of FluentValidation from Core.Model, the exception disappears.
I'm hoping these information is enough. Why do you think I'm getting this exception and how can I eliminate.

Looks like some of libs (ocelot) are incompatible with new changes in FluentValidation 8.1.2. Try to downgrade to FluentValidation before 8.1.2. Hope it helps

I got similar exception:
System.MissingMethodException : Method not found:
'FluentValidation.AssemblyScanner
FluentValidation.AssemblyScanner.FindValidatorsInAssembly(System.Reflection.Assembly)'
In my case I needed to upgrade the ediatR.Extensions.Microsoft.DependencyInjection and MediatR.Extensions.FluentValidation.AspNetCore packages as well to fix the issue.

Related

lit-element : Uncaught (in promise) TypeError: Cannot read property 'previousSibling' of null

On migration to lit-element version 0.6.0. If I use
<script src="node_modules/#webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
in the header part of my document. I have the following error :
Uncaught (in promise) TypeError: Cannot read property 'previousSibling' of null
at NodePart._commitText (parts.ts:255)
at NodePart.commit (parts.ts:216)
at TemplateInstance.update (template-instance.ts:56)
at NodePart._commitTemplateResult (parts.ts:283)
at NodePart.commit (parts.ts:220)
at render (render.ts:48)
at Function.render (shady-render.ts:160)
at HTMLElement.update (lit-element.ts:44)
at HTMLElement._validate (updating-element.ts:600)
at HTMLElement._invalidate (updating-element.ts:574)
I couldn't trace where this error came from as the errors stack is huge and involves a lot of asynchronous calls. Also I tried to reproduce a minimal example, but same, I couldn't emulate the same error message.
The consequence of this error is a complete failure to load some custom elements (to the point the application is unusable).
Now If I change the header script with this one :
<script src="node_modules/#webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
The error just vanishes.. but now the following warning message appears in the console:
Incompatible ShadyCSS version detected. (shady-render.ts:42)
Please update to at least #webcomponents/webcomponentsjs#2.0.2 and#webcomponents/shadycss#1.3.1.
It's a funny message because my project is using webcomponentsjs version 2.1.2 and shadycss version 1.5.2 already.
Besides this warning message the css directives #apply are completely ignored resulting in an interface not using any flex properties (I let you imagine the mess).
Now this is a behavior I really can't understand even though I spent full afternoon digging into documentation and stuff. I summon your help.
There is a known issue with ShadyCSS that was introduced in 0.11.3, so that may be causing your problems with shady-render. I think the fix is already in so it should be resolved with 0.11.4
If you are using LitElement, you should probably be using lit-html version 0.11.2, which is what lit-element itself uses. Otherwise there's a reasonable chance that you are using two different versions, which may also explain some problems.
I can't reproduce your issues though: codepen.io/ruphin/pen/qMyMVO?editors=1010
The only explanation I can come up with is that webcomponents-bundle.js works, which triggers ShadyRender to be used, which breaks. When you switch to webcomponents-loader.js the polyfills don't work for some reason, which causes ShadyRender to not be used and explains why you don't get the error, but get the incompatible polyfill warnings, and don't get properly polyfilled CSS. I don't know why this is happening though, both versions of the polyfill should work, although I generally recommend using -bundle.
It would help if I knew on what browser/version you are seeing the problem.

libc++abi.dylib: terminate_handler unexpectedly threw an exception - 0 stack trace iOS7 / iOS 8

Randomly (that's why I ask the question), my application crashes when want to display data into textView.
The only error message I've got in my debug console is :
libc++abi.dylib: terminate_handler unexpectedly threw an exception
I Googled but can't get a clue to find how correct this and how this happens.
I got the same error and a "clean" didn't resolve it.
It was caused by my internet testing flow, I check to see if WiFi is connected but not if that WiFi has an active internet connection that can resolve a supplied URL. It performs a dataWithContentsOfURL: that will ultimately fail. A similar thread made this suggestion to this question here by user Keith that helped me identify the problem -- which was to add breakpoints to C++ exceptions.
To enable -- click your breakpoints view and the very bottom click the '+' to add a breakpoint. Set it up as follows and the stack trance will be more meaningful.
Clean the project.
Check each constraints and remove the corrupted one.
Clean project again, it should works.
This can be caused by an outlet that is no longer existing (might have been renamed or removed).
Here is a tip on how to check outlets:
Select the container view of the suspected outlet, pay attention to "!" marks in the connections inspector.
I got this question ,because I set [self addObserver:self forKeyPath:#"_defaultAgType" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil];, but I did not remove it in dealloc. I solved this by [self removeObserver:self forKeyPath:#"_defaultAgType"]; in dealloc function.
Another reason why it could happen is when you have a UI element declared but never added to the screen but still you try to do changes on them.
In my case I had a UIBarButtonItem declared in the code but I never added it to View. When I try to remove it without adding it, I had this issue.
If you renamed/moved your view controller class, make sure you've checked Inherit Module From Target on Identity inspector for your scene on the storyboard

Strange errors when linking to libmariadb

I'm currently develop an Objective-C library that links to the MariaDB C connector. I believe there is a problem with the library, though.
Every time I execute my code I get very strange errors on the console. The -(id)init method of my library calls mysql_init(NULL) to initialise the library but as soon as I return from -(id)init I get the following errors in the console:
Object 0x10643df70 of class XXX autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
Thing is, there is no multithreaded code being executed and if I run the same - (id)init without the call to mysql_init(NULL) the errors disappear. I believe the libmariadb library is causing these errors to appear. I don't get why though.
Do I need to build it with any special command line switches? Am I calling the right methods? I obviously used the MySQL online documentation as a guide.
Make sure you add this anytime you have a new thread:
#autoreleasepool {
//enter code here
}
Have you tried latest revision from launchpad?
Also try to build libmariadb with -DUNDEF_THREADS_HACK and
CMAKE_USE_PTHREADS:BOOL=OFF)
I was busy with other stuff for a while. I've since updated MariaDB to the latest version and, as far as I can tell, it works fine.

AS3 Error 1180 Call to a possibly undefined method in IntelliJ

I am getting compiler error:
Error 1180: Call to a possibly undefined method when all imports are ok and all method definitions are ok in IntelliJ, double checked?
What could it be?
I had the same trouble, but solution was very easy. One of my package in project was with name "notification" and it had conflict with standart package name, so i had changed name to "notificationS" and compilier had began work without erros.
The thing is if you did some refactoring on the class that you are getting the error, you have to go to menu:
Build > Rebuild Project
If you just do debug or run, it doesnt work for some reason.
I am not sure if the reason is simple refactoring or some git merge, but solution is here.

ASP.NET MVC: “An internal error occurred.” when loading certificate bytes with X509Certificate2

I have already spent a few hours to resolve this error. The weird thing is when I use this libraries independently, it works absolutely fine but when I integrate them with my ASP .NET MVC website, it start throwing the following exception. I have also used MachineKeySet flag based on suggestion here but still no luck. Could anyone please help me to get rid of this exception. Thanks.
An internal error occurred.
Description: An unhandled exception
occurred during the execution of the
current web request. Please review the
stack trace for more information about
the error and where it originated in
the code.
Exception Details:
System.Security.Cryptography.CryptographicException:
An internal error occurred.
Source Error:
Line 194: if
(string.IsNullOrEmpty(p12FilePassword))
Line 196: certificate = new X509Certificate2(p12FileBytes, "", X509KeyStorageFlags.MachineKeySet);
Line 197: else
I found the solution here. Looks like a known issue. I used X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable flags together and problem disappeared. Other solution is to change the identity of applicationpool to LOCALSERVICE.