web stats
TypeError: Cannot call method "customLogs" of null - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 05-08-2019, 06:47 AM
Kevin Carlin Kevin Carlin is offline
Mirth Newb
 
Join Date: Mar 2012
Posts: 23
Kevin Carlin is on a distinguished road
Default TypeError: Cannot call method "customLogs" of null

Mirth version 3.1.1.7460
I have a channel that I had to restore on a box due to server failure. I have one channel AllSectionsInOne_WithLogs_prod that is failing due to not being able to call a Global script (set up on deploy) on the box.
The global script is the following:
globalMap.put('obj',new Packages.Mirth.MirthLibrary())
return;

The failure on the code appears to be when the transformer calls these lines of code:

globalMap.get('obj').customLogs("D:\\AllSectionsIn One\\"+DateUtil.getCurrentDate("yyyyMMdd")+".txt", "MsgID:"+msg['ccda_msgid'].toString()+"\r\n")

The failure message is the following
DETAILS: TypeError: Cannot call method "customLogs" of null

I have bounced the connection (since the global code ran on the Deploy tab). I am having no luck. Any help would be appreciated.
Reply With Quote
  #2  
Old 05-08-2019, 01:08 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 894
agermano is on a distinguished road
Default

Your error is telling you that either the key obj in the global map has a value of null or it was never set to begin with.

Code:
globalMap.put('obj',new Packages.Mirth.MirthLibrary())
return;
Is this code in your global deploy script or your channel deploy script? You probably don't want to have that in your global deploy script without checking that the object already exists as it will run any time you deploy any channel (overwriting your object.)

Am I correct in assuming that Packages.Mirth.MirthLibrary is a custom class you created?

When you say you "bounced the connection" did you actually redeploy the channel or just stop and restart it?
Reply With Quote
  #3  
Old 05-09-2019, 09:25 AM
Kevin Carlin Kevin Carlin is offline
Mirth Newb
 
Join Date: Mar 2012
Posts: 23
Kevin Carlin is on a distinguished road
Default Solution

I found the issue.

The developer created a custom JAR file which was not moved over to the new box. The file was located in the customlib folder.

I moved it in, stopped/started the Mirth Manager and was good to go.

Thanks everyone for the help.
Reply With Quote
Reply

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 07:45 AM.


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