ashishrathore
02-09-2006, 11:15 AM
hello,
i am running the Chat Applet and i am getting some runtime errors
can u help me in that(if possible)
i had changed the chatfilename according to me and everything is set up-d
i am getting an error like this
===================ERROR================================
java.security.AccessControlException: access denied
(java.net.SocketPermission [file:/C:/New%20Folder/dibella/Chat.java]
resolve)
========================================================
some part of code i am giving...
=====================CODE=============================
public void run()
{
app.showStatus("sending");
try{
chatServer = new URL("http",app.getDocumentBase().toString(),cgiPath+"chat.cgi");
chatServerConnection = chatServer.openConnection();
chatServerConnection.setDoOutput(true);
chatServerConnection.setDoInput(true);
chatServerConnection.setUseCaches(false);
chatServerConnection.setRequestProperty("Content-type","application/octet-stream");
chatServerConnection.setRequestProperty("Content-length",""+completeMessage.length());
DataOutputStream send = new DataOutputStream(chatServerConnection.getOutputStream());
send.writeBytes(completeMessage);
send.flush();
send.close();
app.showStatus("Sent");
DataInputStream in = new DataInputStream(chatServerConnection.getInputStream());
String reply;
while((reply=in.readLine())!=null)
{
System.out.println(reply);
}
in.close();
}
catch(Exception e)
{
app.showStatus("Error sending chat");
System.out.println(e.toString());
}
}
======================================================
can u help me out???
thanx 4 reading...
-ashish
i am running the Chat Applet and i am getting some runtime errors
can u help me in that(if possible)
i had changed the chatfilename according to me and everything is set up-d
i am getting an error like this
===================ERROR================================
java.security.AccessControlException: access denied
(java.net.SocketPermission [file:/C:/New%20Folder/dibella/Chat.java]
resolve)
========================================================
some part of code i am giving...
=====================CODE=============================
public void run()
{
app.showStatus("sending");
try{
chatServer = new URL("http",app.getDocumentBase().toString(),cgiPath+"chat.cgi");
chatServerConnection = chatServer.openConnection();
chatServerConnection.setDoOutput(true);
chatServerConnection.setDoInput(true);
chatServerConnection.setUseCaches(false);
chatServerConnection.setRequestProperty("Content-type","application/octet-stream");
chatServerConnection.setRequestProperty("Content-length",""+completeMessage.length());
DataOutputStream send = new DataOutputStream(chatServerConnection.getOutputStream());
send.writeBytes(completeMessage);
send.flush();
send.close();
app.showStatus("Sent");
DataInputStream in = new DataInputStream(chatServerConnection.getInputStream());
String reply;
while((reply=in.readLine())!=null)
{
System.out.println(reply);
}
in.close();
}
catch(Exception e)
{
app.showStatus("Error sending chat");
System.out.println(e.toString());
}
}
======================================================
can u help me out???
thanx 4 reading...
-ashish