Page 1 of 1

Plugin caused an exception - object reference error

PostPosted: Mon Dec 16, 2019 10:14 pm
by Riyaz
Hi There

Am getting a weird "plugin caused an exception error" of the Jiwa plugins, v7.2.1

The error wont appear if I login via Jiwa, but I use a custom program to login via the dlls and I get this error, if I disable this plugin, it prompts the same error on a different one, all of them of Jiwa Financials, listed as below. Another thing to note is that, I dont get this error on our test server which runs the same jiwa version. Hence am a bit puzzled. Can you pls advise.

1.Copy Bill Custom Field Values To Work Order
2.Inventory Import Debtor Specific Prices
3.Inventory Import Notes
4.Purchase Order Generation Reorder Method - Sales Forecast
5.Purchase Order Generation Reorder Method - Replenish to Minimum

Re: Plugin caused an exception - object reference error

PostPosted: Tue Dec 17, 2019 5:52 am
by SBarnes
Have added all the Jiwa DLLs as references to you project, Jiwa's references are resolved to the local directory not to the GAC, so if the Jiwa DLLs are not in the program directory this could be an issue.

Also if you have any Business Logic plugins that execute code that would be of a User Interface nature i.e. they assume the user interface is there this could cause this type of error as well. You can check if the user interface is present by checking if MDIParentForm is null.

Re: Plugin caused an exception - object reference error  Topic is solved

PostPosted: Tue Dec 17, 2019 9:00 am
by Mike.Sheen
SBarnes wrote:Jiwa's references are resolved to the local directory not to the GAC, so if the Jiwa DLLs are not in the program directory this could be an issue.


Pretty much this.

You don't HAVE to copy all the Jiwa assemblies to the folder your application is running in, if you add a custom assembly resolver to your application. This is simply you handling the AppDomain.CurrentDomain.AssemblyResolve event in your application and in that handler you tell fusion where to find the assemblies it's looking for. An example of this can be found in this post.

Re: Plugin caused an exception - object reference error

PostPosted: Tue Dec 17, 2019 10:15 am
by SBarnes
As suggestion would it be possible to add a parameter to the login method to to pass in the Jiwa program directory?

Re: Plugin caused an exception - object reference error

PostPosted: Tue Dec 17, 2019 4:38 pm
by Riyaz
Thanks Mike and Stuart

The example provided by Mike was quite useful