Printing From A Servlet

Hi;

I have a bit of an odd situation that I am hoping somebody can give me a clue about.

I have a servlet that retrieves large multipage strings from a database and then sends those strings to an applet.

The servlet also sends this string to a printer.

The servlet is sitting on a server running NT server 4.0 and Servlet Exec 2.0.2.

The servlet uses an accessory class I made called "PrintSummaryStatements". This class reads from a file, writes to file, and sends the string to the printer.

The reading and writing functions of this class work. The printing function worked when I tested it outside of the servlet.

However, when the servlet calls this printing funciton NOTHING happens. A java exception gets thrown that says "Access Denied". The accessory class is in the same directory as the servlet.

My boss is a networking guru. I had him check the server the servlet is sitting on and he says all of the persmissions are wide open.

I guess I am stuck as to what the way out is.

You can download the java files for the servlet and its accessory class "PrintSummaryStatements" at:
http://softdev.nimh.nih.gov/Projects/Temp/question.html

The printing function in question is fairly short. Here it is:

public void printAsText( String sSummaryStatement )
{
String sFormattedSummaryStatement;
sFormattedSummaryStatement = format(sSummaryStatement);

try
{
FileOutputStream fos = new FileOutputStream("\\\\softdev\\nimhsdhp5port");
PrintStream ps = new PrintStream(fos);
ps.print("\r");
ps.print(sFormattedSummaryStatement);
ps.print("\f");
ps.close();
}
catch ( Exception e )
{
System.err.println("Summary Statement Did Not Print: " + e);
}
}// end function printAsText()

The function called "format" is another function in the accessory class that this function also belongs to. It works. The path to the printer has the right amount of slashes.

Any help would be greatly appreciated

[Wed Jun 30 09:39:29 EDT 1999] (default) : Servlet: Summary Statement Did Not Print: java.io.FileNotFoundException: \\softdev\nimhsdhp5port (Access is denied)

Thanks in adavance

Steve
[2382 byte] By [Steve Russell] at [2007-11-15 19:14:56]