Troubleshooting ERROR_INPUT_STREAM_OPEN errors from the Symantec Protection Engine Java SDK.
search cancel

Troubleshooting ERROR_INPUT_STREAM_OPEN errors from the Symantec Protection Engine Java SDK.

book

Article ID: 152577

calendar_today

Updated On:

Products

Protection Engine for Cloud Services Protection Engine for NAS

Issue/Introduction

What can cause the "ERROR_INPUT_STREAM_OPEN" error while using the Symantec Scan Engine Java SDK?

 

Resolution

The ERROR_INPUT_STREAM_OPEN error is typically thrown when the Java API encounters a problem while opening the input stream.  The issue is normally caused by the Java API timing out the connection to Protection Engine After the file scan has been requested.  The default time out in the Java API is Inherited from Java and is 2 seconds. 

This error can commonly be resolve by adding or adjusting times out values on the "createScanEngine" on the java connector.  A good starting point on this is to set the read write timeout to 20000 and the fail retry time out to 30000.  These values are in milliseconds.

Here is an excerpt from Java API help for Protection Engine 7.5 that shows the syntax that resolves the issue.

createScanEngine

public static ScanEngine createScanEngine(java.util.List<ScanEngine.ScanEngineInfo> scanEngInfo,
                                          int readWriteTime,
                                          int failRetryTime)
                                   throws ScanException
The createScanEngine method initializes the Symantec Protection Engines for scanning.
Parameters:
scanEngInfo - list of scan engine info objects.
readWriteTime - socket read timeout in milliseconds
failRetryTime - time in milliseconds used by load balancing algorithm to decide the amount of time for which a failed Symantec Protection Engine in the list should be ignored for connection
Returns:
ScanEngine instance
Throws:
ScanException
java.lang.IllegalArgumentException

 

If the above values don't fix the issue, consider increasing as per the below values: 

 change the below line in JAVAAPICheck.java (Line no. 690)

System.out.println("Going to create scan engine ");

ScanEngine scanEngine = ScanEngine.createScanEngine(scanEnginesForScanning3000000, 300000);

System.out.println("Scan engine created, Now creating FileInputStream " + fileForScan);

After change compile the Java file and attempt scanning, and then check the results

 

Additional Information

This is also valid for the DotNet/C# method PrepareForScan:

public void PrepareForScan(
    List<ScanEngineInfo> scanEngines,
    int readWriteTimeout,
    int ipRetryTime
)

The default example given is 20 seconds for readWriteTimeout, so that should be increased