web stats
Import Custom JAR inside MIRTH. (2.2.1.5861) - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 07-07-2016, 11:27 AM
Awdesh Awdesh is offline
What's HL7?
 
Join Date: Jun 2016
Posts: 1
Awdesh is on a distinguished road
Default Import Custom JAR inside MIRTH. (2.2.1.5861)

I am using MIRTH to call to external API endpoint which is https. Since MIRTH doesn't inherently has capability to call to https, it throws ssl exception. I created a jar which will allow localhost to bypass ssl checking. Now I put that jar inside MirthConenct->custom-lib folder. Below is my jar's structure.

package Mirth.ssl;
public class TrustSSLCerts{
............. }
from Transformer's javascript writer I do

importPackage(Packages.Mirth.ssl.*);

foo() {
var ssl = new TrustSSLCerts();
}
On deploying channel and sending dummy data, it errors out-:

ReferenceError: "TrustSSLCerts" is not defined.

I am running MIRTH (2.2.1.5861). Any help regarding that is highly appreciated.
Reply With Quote
  #2  
Old 07-08-2016, 01:30 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 280
AlexNeiva is on a distinguished road
Default

Hello Awdesh,

after you copy the jar file to custom-lib did you restart Mirth Service?
i use a more updated Mirth version but i use jar files too and to call them out i do:

Code:
var obj = new Packages.Mirth.ssl();
var ret = obj.TrustSSLCerts();
and at first glance i see that you are calling a class and not a function... try calling a function inside your class.

example:

Code:
package Mirth.ssl;

public class TrustSSLCerts
{
           public static void MySSL()
           {
                     .............
            }
   }
then on Mirth:

Code:
var obj = new Packages.Mirth.ssl.TRustSSLCerts();
var ret = obj.MySSL();
Give it a try.

Best Regards
Reply With Quote
Reply

Tags
custom, import, jar, reference error

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 05:01 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation