com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: HTTP Client with JSON CONNECTOR: Destination 1 SCRIPT SOURCE: response SOURCE CODE: 39: } 40: eval('importPackage(' + Packages.java.lang.Class.forName(className).getPackage().getName() + ')'); 41: } 42: } 43: function doScript() { 44: msg = JSON.parse(connectorMessage.getResponseTransformedData()); 45: function doTransform() { 46: 47: 48: var mapping; LINE NUMBER: 44 DETAILS: SyntaxError: Unexpected token: o at d89555a6-f1d2-4738-a164-48b213af267f:44 (doScript) at d89555a6-f1d2-4738-a164-48b213af267f:91

Mirth Project | Eric Butterfield | 1 year ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Not sure if this is at all related to MIRTH-3824... In version 3.3.0, you could put a JSON object into a Response object, and choose that response in your source connector, and everything would work just fine. When you viewed the response message (whether in the receiving channel's source or the sending channel's destination), you would correctly see the JSON object that was put into the response. So, for example, you could do something like this in the Postprocessor, and respond from the Postprocessor: var jsonObj = { "result": "This is the result.", "data": "This is some other data." } return ResponseFactory.getSentResponse(jsonObj); However, it's no longer working this way in 3.3.1. Now, when you look at the response message in the message view, you see: [object Object] And if you try to use the response in a response transformer, you get an error like this: Response Transformer error ERROR MESSAGE: Error evaluating response transformer com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: HTTP Client with JSON CONNECTOR: Destination 1 SCRIPT SOURCE: response SOURCE CODE: 39: } 40: eval('importPackage(' + Packages.java.lang.Class.forName(className).getPackage().getName() + ')'); 41: } 42: } 43: function doScript() { 44: msg = JSON.parse(connectorMessage.getResponseTransformedData()); 45: function doTransform() { 46: 47: 48: var mapping; LINE NUMBER: 44 DETAILS: SyntaxError: Unexpected token: o at d89555a6-f1d2-4738-a164-48b213af267f:44 (doScript) at d89555a6-f1d2-4738-a164-48b213af267f:91 at com.mirth.connect.server.transformers.JavaScriptResponseTransformer$ResponseTransformerTask.call(JavaScriptResponseTransformer.java:160) at com.mirth.connect.server.transformers.JavaScriptResponseTransformer$ResponseTransformerTask.call(JavaScriptResponseTransformer.java:118) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) I've attached a couple of channels (an HTTP Sender that sends to an HTTP Listener with JSON as the data type) that demonstrate this. The channels work perfectly fine under 3.3.0, but cause an error under 3.3.1.

    Mirth Project | 1 year ago | Eric Butterfield
    com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: HTTP Client with JSON CONNECTOR: Destination 1 SCRIPT SOURCE: response SOURCE CODE: 39: } 40: eval('importPackage(' + Packages.java.lang.Class.forName(className).getPackage().getName() + ')'); 41: } 42: } 43: function doScript() { 44: msg = JSON.parse(connectorMessage.getResponseTransformedData()); 45: function doTransform() { 46: 47: 48: var mapping; LINE NUMBER: 44 DETAILS: SyntaxError: Unexpected token: o at d89555a6-f1d2-4738-a164-48b213af267f:44 (doScript) at d89555a6-f1d2-4738-a164-48b213af267f:91
  2. 0

    Not sure if this is at all related to MIRTH-3824... In version 3.3.0, you could put a JSON object into a Response object, and choose that response in your source connector, and everything would work just fine. When you viewed the response message (whether in the receiving channel's source or the sending channel's destination), you would correctly see the JSON object that was put into the response. So, for example, you could do something like this in the Postprocessor, and respond from the Postprocessor: var jsonObj = { "result": "This is the result.", "data": "This is some other data." } return ResponseFactory.getSentResponse(jsonObj); However, it's no longer working this way in 3.3.1. Now, when you look at the response message in the message view, you see: [object Object] And if you try to use the response in a response transformer, you get an error like this: Response Transformer error ERROR MESSAGE: Error evaluating response transformer com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: HTTP Client with JSON CONNECTOR: Destination 1 SCRIPT SOURCE: response SOURCE CODE: 39: } 40: eval('importPackage(' + Packages.java.lang.Class.forName(className).getPackage().getName() + ')'); 41: } 42: } 43: function doScript() { 44: msg = JSON.parse(connectorMessage.getResponseTransformedData()); 45: function doTransform() { 46: 47: 48: var mapping; LINE NUMBER: 44 DETAILS: SyntaxError: Unexpected token: o at d89555a6-f1d2-4738-a164-48b213af267f:44 (doScript) at d89555a6-f1d2-4738-a164-48b213af267f:91 at com.mirth.connect.server.transformers.JavaScriptResponseTransformer$ResponseTransformerTask.call(JavaScriptResponseTransformer.java:160) at com.mirth.connect.server.transformers.JavaScriptResponseTransformer$ResponseTransformerTask.call(JavaScriptResponseTransformer.java:118) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) I've attached a couple of channels (an HTTP Sender that sends to an HTTP Listener with JSON as the data type) that demonstrate this. The channels work perfectly fine under 3.3.0, but cause an error under 3.3.1.

    Mirth Project | 1 year ago | Eric Butterfield
    com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: HTTP Client with JSON CONNECTOR: Destination 1 SCRIPT SOURCE: response SOURCE CODE: 39: } 40: eval('importPackage(' + Packages.java.lang.Class.forName(className).getPackage().getName() + ')'); 41: } 42: } 43: function doScript() { 44: msg = JSON.parse(connectorMessage.getResponseTransformedData()); 45: function doTransform() { 46: 47: 48: var mapping; LINE NUMBER: 44 DETAILS: SyntaxError: Unexpected token: o at d89555a6-f1d2-4738-a164-48b213af267f:44 (doScript) at d89555a6-f1d2-4738-a164-48b213af267f:91
  3. 0

    How to consume simple SOAP webservice through MirthConnect? - Mirth Community

    mirthcorp.com | 11 months ago
    com.mirth.connect.server.MirthJavascriptTransformerException: CHANNEL: wsdl_reader CONNECTOR: currency service SCRIPT SOURCE: response SOURCE CODE: 20: } 21: eval('importPackage(' + Packages.java.lang.Class.forName(className).getPackage().getName() + ')'); 22: } 23: } 24: function doScript() { 25: msg = new XML(connectorMessage.getResponseTransformedData()); 26: if (msg.namespace('') != undefined) { default xml namespace = msg.namespace(''); } else { default xml namespace = ''; } 27: function doTransform() { 28: 29: LINE NUMBER: 25 at 304423fc-979c-4676-b2dd-48b7499bb9e3:25 (doScript) at 304423fc-979c-4676-b2dd-48b7499bb9e3:37
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.mirth.connect.server.MirthJavascriptTransformerException

      CHANNEL: HTTP Client with JSON CONNECTOR: Destination 1 SCRIPT SOURCE: response SOURCE CODE: 39: } 40: eval('importPackage(' + Packages.java.lang.Class.forName(className).getPackage().getName() + ')'); 41: } 42: } 43: function doScript() { 44: msg = JSON.parse(connectorMessage.getResponseTransformedData()); 45: function doTransform() { 46: 47: 48: var mapping; LINE NUMBER: 44 DETAILS: SyntaxError: Unexpected token: o at d89555a6-f1d2-4738-a164-48b213af267f:44 (doScript) at d89555a6-f1d2-4738-a164-48b213af267f:91

      at com.mirth.connect.server.transformers.JavaScriptResponseTransformer$ResponseTransformerTask.call()
    2. com.mirth.connect
      JavaScriptResponseTransformer$ResponseTransformerTask.call
      1. com.mirth.connect.server.transformers.JavaScriptResponseTransformer$ResponseTransformerTask.call(JavaScriptResponseTransformer.java:160)
      2. com.mirth.connect.server.transformers.JavaScriptResponseTransformer$ResponseTransformerTask.call(JavaScriptResponseTransformer.java:118)
      2 frames
    3. Java RT
      Thread.run
      1. java.util.concurrent.FutureTask.run(Unknown Source)
      2. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      3. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      4. java.lang.Thread.run(Unknown Source)
      4 frames