My Oracle Support Banner

Custom scripting not opening file for output (eScript) (Doc ID 1999536.1)

Last updated on FEBRUARY 09, 2018

Applies to:

Siebel CRM - Version 8.1.1.14 [IP2014] and later
Information in this document applies to any platform.

Symptoms

Custom scripting in opening a system file for logging crashes the application.

ERROR
-----------------------

Unhandled Exception: Access Denied: Cannot access system files or shellService.Service_PreInvokeMethod line: 5


STEPS
-----------------------
The issue has been reproduced using two different flows, as described below:

  FLOW A. Using Dedicated > Administration - Business Service > Details > Simulator

  1. Added in System preference of Siebel Application (Name = Value) - Allow File System Access* = TRUE**
  2. Created Business Service "SC_CLIB", with the following script:

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{
 if(MethodName == "Execute")
  {
  var file = Clib.fopen("c:\\Test\\Test.txt", "awt");
  return(CancelOperation);
  }
  return (ContinueOperation);
}


  3. Added method "Execute"
  4. Went to Simulator, created a new line for this Service
  5. Clicked Run and error appeared.

* In IP2013 version the Allow File System Access preference is set to True by default, but in latest versions it's replaced by 2 other preferences that target server and client side scripts:
             - Runtime Scripts System Access (default is false)
             - Compiled Scripts System Access (default is true)

** This was set for testing purposes, because in IP2013 it used to solve the issue of writing to system files. For reference please visit: Siebel eScript: "Access Denied: Cannot access file system file or shell" error in file i/o method of the Clib object (Doc ID 1594198.1)

FLOW B. Using Siebel Tools, added the following lines in "WebApplet_PreInvokeMethod" from Bookshelf 8.1/8.2 > Siebel eScript Language Reference > C Language Library Reference > Clib File and Directory Methods > Clib Open File Method

 

  var oFile = Clib.fopen("C:\\Test\\Test.txt","rw");
  if (null != oFile)
  {
  var sHello = "Hello";
  var nLen = sHello.length;
  Clib.fputs(sHello, oFile);
  Clib.rewind(oFile);
  Clib.fgets (nLen, sHello);
  }

  And Siebel Application fails with a Crash:

[Window Title]
Siebel Mobile Client

[Main Instruction]
Siebel Mobile Client has stopped working

[Content]
A problem caused the program to stop working correctly. Please close the program.

[Close the program]

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.