Service Virtualization

  • 1.  Service working in VSE but failing in ITR

    Posted Oct 16, 2018 05:00 AM

    Hi All, 

    Greetings !

     

    Request your advise for an issue like this :

     

    When the Service is deployed in VSE it is working as expected.

     

    When we are running in ITR, it is experiencing an unexpected error saying FileNotFoundException(Access Denied) when trying to write to the file.(Full log provided below)

     

    This seems strange as the same service was working earlier and I have full access to the file system.

    Pls help with Suggestions/remedial measures.

     

     

    Full Error Log below:

    ===========================================================================
    | Error in Script
    ============================================================================
    | Step: Write to NewOrderInfo ModifyORder
    ----------------------------------------------------------------------------
    | Message: bsh.TargetError: Sourced file: inline evaluation of: ``import java.io.FileInputStream; import java.io.FileOutputStream; import java.i . . . '' : Typed variable declaration : Object constructor : at Line: 43 : in file: inline evaluation of: ``import java.io.FileInputStream; import java.io.FileOutputStream; import java.i . . . '' : new FileOutputStream ( "D:/DataStorage/SVDataStorage.xlsx" )

    Target exception: java.io.FileNotFoundException: D:\DataStorage\SVDataStorage.xlsx (Access is denied)
    in inline evaluation of: ``import java.io.FileInputStream; import java.io.FileOutputStream; import java.i . . . '' at line number 43
    ----------------------------------------------------------------------------
    | Trapped Exception: bsh.TargetError: Sourced file: inline evaluation of: ``import java.io.FileInputStream; import java.io.FileOutputStream; import java.i . . . '' : Typed variable declaration : Object constructor : at Line: 43 : in file: inline evaluation of: ``import java.io.FileInputStream; import java.io.FileOutputStream; import java.i . . . '' : new FileOutputStream ( "D:/DataStorage/SVDataStorage.xlsx" )

    Target exception: java.io.FileNotFoundException: D:\DataStorage\SVDataStorage.xlsx (Access is denied)
    in inline evaluation of: ``import java.io.FileInputStream; import java.io.FileOutputStream; import java.i . . . '' at line number 43
    | Trapped Message: javax.script.ScriptException: bsh.TargetError: Sourced file: inline evaluation of: ``import java.io.FileInputStream; import java.io.FileOutputStream; import java.i . . . '' : Typed variable declaration : Object constructor : at Line: 43 : in file: inline evaluation of: ``import java.io.FileInputStream; import java.io.FileOutputStream; import java.i . . . '' : new FileOutputStream ( "D:/DataStorage/SVDataStorage.xlsx" )

    Target exception: java.io.FileNotFoundException: D:\DataStorage\SVDataStorage.xlsx (Access is denied)
    in inline evaluation of: ``import java.io.FileInputStream; import java.io.FileOutputStream; import java.i . . . '' at line number 43
    ----------------------------------------------------------------------------
    STACK TRACE
    javax.script.ScriptException: bsh.TargetError: Sourced file: inline evaluation of: ``import java.io.FileInputStream; import java.io.FileOutputStream; import java.i . . . '' : Typed variable declaration : Object constructor : at Line: 43 : in file: inline evaluation of: ``import java.io.FileInputStream; import java.io.FileOutputStream; import java.i . . . '' : new FileOutputStream ( "D:/DataStorage/SVDataStorage.xlsx" )

    Target exception: java.io.FileNotFoundException: D:\DataStorage\SVDataStorage.xlsx (Access is denied)
    in inline evaluation of: ``import java.io.FileInputStream; import java.io.FileOutputStream; import java.i . . . '' at line number 43
    at bsh.BshScriptEngine.evalSource(BshScriptEngine.java:97)
    at bsh.BshScriptEngine.
    at javax.script.AbstractScriptEngine.
    at com.itko.lisa.test.ScriptExecHandler.executeScript(ScriptExecHandler.java:674)
    at com.itko.lisa.test.ScriptExecHandler.executeScript(ScriptExecHandler.java:427)
    at com.itko.lisa.test.UserScriptNode._execute(UserScriptNode.java:210)
    at com.itko.lisa.editor.UserScriptNodeEditor.execute(UserScriptNodeEditor.java:214)
    at com.itko.lisa.editor.UserScriptNodeEditor.access$000(UserScriptNodeEditor.java:49)
    at com.itko.lisa.editor.UserScriptNodeEditor$1.actionPerformed(UserScriptNodeEditor.java:73)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$500(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: D:\DataStorage\SVDataStorage.xlsx (Access is denied)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(Unknown Source)
    at java.io.FileOutputStream.<init>(Unknown Source)
    at java.io.FileOutputStream.<init>(Unknown Source)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at bsh.Reflect.constructObject(Reflect.java:575)
    at bsh.BSHAllocationExpression.constructObject(BSHAllocationExpression.java:125)
    at bsh.BSHAllocationExpression.objectAllocation(BSHAllocationExpression.java:114)
    at bsh.BSHAllocationExpression.
    at bsh.BSHPrimaryExpression.
    at bsh.BSHPrimaryExpression.
    at bsh.BSHVariableDeclarator.
    at bsh.BSHTypedVariableDeclaration.
    at bsh.Interpreter.
    at bsh.Interpreter.
    at bsh.Interpreter.
    at bsh.BshScriptEngine.evalSource(BshScriptEngine.java:89)
    ... 44 more
    ============================================================================



  • 2.  Re: Service working in VSE but failing in ITR

    Broadcom Employee
    Posted Oct 16, 2018 05:32 AM

    Does the file already exist on your local filesystem?

    If yes,

     

       

    •   looking at the file properties, is the file marked as “Read-Only”? If so, try setting it to “Read-Write”

       

    •   looking at the directory properties (D:/DataStorage), is the directory marked as “Read-Only”? If so, try setting it to “Read-Write”

    If no,

     

       

    •   looking at the directory properties (D:/DataStorage), is the directory marked as “Read-Only”? If so, try setting it to “Read-Write”

     

    That would be the first areas where I would look.

     

    Cheers,

    Danny



  • 3.  Re: Service working in VSE but failing in ITR

    Posted Oct 16, 2018 06:23 AM

    Thanks Danny.

     

    Yes The file exists.

    Not able to write to it through DevTest though.

     

    Able to speak to the file with service deployed in VSE.



  • 4.  Re: Service working in VSE but failing in ITR
    Best Answer

    Broadcom Employee
    Posted Oct 16, 2018 06:43 AM

    And you have checked that everything – directory and file itself - is read-write, correct?

     

    “… Able to speak to the file with service deployed in VSE …” is this a VSE running on the same host as the workstation where it fails?

     

    If you delete the file first, do you still get the same error?

     

    Still thinking it is security related (which is also what the java documentation for OutputFileStream shows): if you start the Workstation with “Run as Administrator”, do you still get the same error?

     

    Cheers,

    Danny



  • 5.  Re: Service working in VSE but failing in ITR

    Posted Oct 16, 2018 07:18 AM

    Thanks for your time Danny.

    Not understanding how it was working earlier, Running as Administrator works !



  • 6.  Re: Service working in VSE but failing in ITR

    Broadcom Employee
    Posted Oct 16, 2018 07:33 AM

    Ok, good to hear.

     

    It must be something with the rights of your regular windows user. (VSE on Windows runs default under Local System Account user)

     

    Cheers,

    Danny