Click to See Complete Forum and Search --> : ACCESS DENIED Problem


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

Khalid Ali
02-11-2006, 02:02 PM
seem slike u are trying to access a resource that resides on system(disk drive) you will need to sign your applet appropriately to access such files. And one more thing sometimes folder name such as "Program Files" may cause problems cus of the space in between.