WLS -Trying to create and/or read a file in a network mapped directory causes "The system cannot find the path specified" error when WLS is started as service

(Doc ID 775275.1)

Last updated on MAY 26, 2017

Applies to:

Oracle WebLogic Server - Version 8.1 to 12.1.1.0
Information in this document applies to any platform.
Information in this document applies to any platform

***Checked for relevance on 3-Jun-2014***

Symptoms

When using a JSP in a webapp, the JSP is able to write/read a file in a network mapped drive when the server is started using the startWeblogic script. If the server is started as a service then the error:

"The system cannot find the path specified" is thrown.  Changing the log on identity of the service using the Windows management console did not work.

Sample JSP code:

<html>
<head><title>Write File</title></head>
<body>

<%
try {
java.io.File f = new File("H:\\testFile.txt"); \\(The H: drive is the network drive)
f.createNewFile();
out.println("File written successfully");
}
catch (Exception ex) {
out.println(ex.getMessage());
System.out.println(ex.getMessage());
}
%>

</body>
</html>

Changes

 

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms