Plugin caused an exception - object reference error  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Plugin caused an exception - object reference error

Postby Riyaz » Mon Dec 16, 2019 10:14 pm

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
Attachments
image (4).png
image (4).png (34.33 KiB) Viewed 511 times
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2

Re: Plugin caused an exception - object reference error

Postby SBarnes » Tue Dec 17, 2019 5:52 am

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.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

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

Postby Mike.Sheen » Tue Dec 17, 2019 9:00 am

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755

Re: Plugin caused an exception - object reference error

Postby SBarnes » Tue Dec 17, 2019 10:15 am

As suggestion would it be possible to add a parameter to the login method to to pass in the Jiwa program directory?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Plugin caused an exception - object reference error

Postby Riyaz » Tue Dec 17, 2019 4:38 pm

Thanks Mike and Stuart

The example provided by Mike was quite useful
Riyaz
Kohai
Kohai
 
Posts: 233
Joined: Wed Dec 02, 2015 2:05 pm
Topics Solved: 2


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests