filenotfound exception
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alex_Poon
Posted On:   Wednesday, May 30, 2001 10:38 PM

Sometimes I get the following error when I try to close an OutputStream from an applet: java.io.FileNotFoundException: Domain:80//Myservlet/anyfile.svt at com/ms/net/wininet/http/HttpInputStream.connect at com/ms/net/wininet/http/HttpInputStream. at com/ms/net/wininet/http/HttpURLConnection.createInputStream at com/ms/net/wininet/WininetURLConnection.getInputStream at com/ms/net/wininet/http/HttpPostBufferStream.close at java/io/FilterOutputStream.close at comapplet/ServletWriter.postObjects at comapplet/ComApplet.postText Notice that the URL in the error is formatted with // after the port. When I actually create the URL I only put one /. Does anyone know how the URL gets c   More>>

Sometimes I get the following error when I try to close an OutputStream from an applet:

java.io.FileNotFoundException: Domain:80//Myservlet/anyfile.svt
at com/ms/net/wininet/http/HttpInputStream.connect
at com/ms/net/wininet/http/HttpInputStream.
at com/ms/net/wininet/http/HttpURLConnection.createInputStream
at com/ms/net/wininet/WininetURLConnection.getInputStream
at com/ms/net/wininet/http/HttpPostBufferStream.close
at java/io/FilterOutputStream.close
at comapplet/ServletWriter.postObjects
at comapplet/ComApplet.postText

Notice that the URL in the error is formatted with // after the port. When I actually create the URL I only put one /. Does anyone know how the URL gets changed after the connection gets created. Here is what I am doing:


URLConnection con;

try
{
con = servlet.openConnection();
}
catch(Exception e)
{
throw e;
}


con.setDoInput( true );
con.setDoOutput( true );
con.setUseCaches( false );
con.setRequestProperty( "Content-Type","foobar" );
con.setAllowUserInteraction(false);

DataOutputStream osw;

try
{
osw = new DataOutputStream(con.getOutputStream());
osw.writeBytes(data);
}
catch(Exception e)
{
throw e;
}

try
{
osw.flush();
}
catch(IOException ioe)
{
throw ioe;
}
catch(Exception e)
{
throw e;
}

try
{
osw.close();
}
catch(IOException ioe)

   <<Less
About | Sitemap | Contact