Announcement

Collapse
No announcement yet.

Import Custom JAR inside MIRTH. (2.2.1.5861)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    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
    Best Regards,
    Alex Neiva

    Comment

    Working...
    X