Root cause of JavaScriptException: java.lang.IllegalAccessException

craig dawson
Tera Contributor

Good Morning all 

we have just updated to Washington 

i have come on this morning to find that one of the schulded jobs that run every two hours is now generating this error 

Import Error: Evaluation error: JavaScript evaluation error on:var remoteFileImport = new DTMIDServerRemoteFileImport(); remoteFileImport.getRemoteFileAndUplo
The following error occurred with the Remote File Import functionality that imports alerts into ServiceNow from the spreadsheet on the Mid Server:
Evaluation error: JavaScript evaluation error on:
var remoteFileImport = new DTMIDServerRemoteFileImport();
remoteFileImport.getRemoteFileAndUploadToInstance()
Root cause of JavaScriptException: java.lang.IllegalAccessException

is anyone able to advised or possible guide me what this could be doing 

these where all working yesterday just since the update to Washington 

9 REPLIES 9

EnriT
Tera Expert

Heya,

Forgot to reply here previously, but the issue is caused due to an update in the JRE version that is being utilized by the MidServer, this was communicated out last year prior to Vancouver release.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1273036
Solution is fairly simple, update the wrapper.cfg or wrapper-override.cfg files of the MidServer to include:

***
# Java Additional Parameters from File
#wrapper.java.additional_file=
wrapper.java.additional.137=--add-opens=java.base/java.net=ALL-UNNAMED
wrapper.java.additional.138=--add-opens=java.base/javax.xml=ALL-UNNAMED
wrapper.java.additional.139=--add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED
wrapper.java.additional.140=--add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED
wrapper.java.additional.141=--add-opens=java.base/sun.net.www.http=ALL-UNNAMED
wrapper.java.additional.142=--add-opens=java.base/java.lang.reflect=ALL-UNNAMED

***




catherinewil
Mega Expert

Hey,

 

Thanks for the update! It looks like the issue is related to the recent JRE update for the MidServer, as noted in the Vancouver release communication. To fix it, you need to update the wrapper.cfg or wrapper-override.cfg files of the MidServer with the following entries:

 

# Java Additional Parameters from File
#wrapper.java.additional_file=
wrapper.java.additional.137=--add-opens=java.base/java.net=ALL-UNNAMED
wrapper.java.additional.138=--add-opens=java.base/javax.xml=ALL-UNNAMED
wrapper.java.additional.139=--add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED
wrapper.java.additional.140=--add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED
wrapper.java.additional.141=--add-opens=java.base/sun.net.www.http=ALL-UNNAMED
wrapper.java.additional.142=--add-opens=java.base/java.lang.reflect=ALL-UNNAMED

 

This should resolve the access issue. If you need more help, feel free to reach out!

 

It worked for us, thank you.

Hey @catherinewil 

 

This fixed the issue for us, but I'm a little unsure of what I just implemented or what it's actually doing. Do you happen to have any additional docs or resources of what these lines are actually doing or instructing the MID Server to do?

 

I'd like to better understand what we're doing now before we make these changes in prod.

I had this written out in my initial response to this thread, but sadly that got lost and did not get accepted as the solution.
This change was needed due to the JRE engine that was done as part of the Vancouver release, more info in the KB article of why it is needed and how to fix it:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1273036