Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Mid Server JAR

CY2
Tera Contributor

Hi, how can i execute a JAR file that is located in the MID server? 

Below is the code that i ran with Background Script:

var jspr = new JavascriptProbe('testmidserver');


jspr.setName('testMIDServer');


jspr.setJavascript("var doSomething = new Packages.com.javaapplication7.monkey();ms.log('Hello World'); doSomething.king()");


jspr.create();

 

ECC queve return me with the below error message:

 

<?xml version="1.0" encoding="UTF-8"?><results error="Caused by error in JavaScript probe 'testMIDServer' at line 1&#10;&#10;==&gt; 1: var doSomething = new Packages.com.javaapplication7.monkey();ms.log('Hello World'); doSomething.king()&#10;" probe_time="24" result_code="900000"><result error="Caused by error in JavaScript probe 'testMIDServer' at line 1&#10;&#10;==&gt; 1: var doSomething = new Packages.com.javaapplication7.monkey();ms.log('Hello World'); doSomething.king()&#10;"><output>Evaluation error: Caused by error in JavaScript probe 'testMIDServer' at line 1

==&gt; 1: var doSomething = new Packages.com.javaapplication7.monkey();ms.log('Hello World'); doSomething.king()</output></result><parameters><parameter name="agent" value="mid.server.testmidserver"/><parameter name="response_to" value=""/><parameter name="from_sys_id" value=""/><parameter name="source" value=""/><parameter name="priority" value="2"/><parameter name="agent_correlator" value=""/><parameter name="script" value="var doSomething = new Packages.com.javaapplication6;ms.log('Hello World'); doSomething()"/><parameter name="processed" value=""/><parameter name="error_string" value=""/><parameter name="sys_id" value="db5cb2f9db90230096e8a0f2ca961943"/><parameter name="sequence" value="1659dd11afe0000001"/><parameter name="from_host" value=""/><parameter name="sys_created_on" value="2018-09-03 05:04:11"/><parameter name="sys_domain" value="global"/><parameter name="name" value="testMIDServer"/><parameter name="topic" value="JavascriptProbe"/><parameter name="state" value="ready"/><parameter name="queue" value="output"/><parameter name="ecc_queue" value="db5cb2f9db90230096e8a0f2ca961943"/></parameters></results>

 

 

Please help me T_T

1 ACCEPTED SOLUTION

15 REPLIES 15

Happy Happy !!