[3013] in java-interest

home help back first fref pref prev next nref lref last post

No subject found in mail header

daemon@ATHENA.MIT.EDU (Mohamed Bazzi)
Thu Oct 26 21:40:25 1995

From: bazzi@rennes.enst-bretagne.fr (Mohamed Bazzi)
Date: Thu, 26 Oct 1995 16:14:40 +0100
To: java-interest@java.Eng.Sun.COM

I am trying to run an applet which get a binary file from a server and copy it on /usr/tmp
directory, i run the applet with appletviewer, but i get the following message at run time :
Thread-5 find class WhiteBoard
Opening stream to: file:/homes/bazzi/.www/WhiteBoard.class to get WhiteBoard
*** Security Exception: socket.connect:->bloodmoney ***
sun.applet.AppletSecurityException security.socket.connect: ->bloodmoney
        at java.lang.Throwable.<init>(Throwable.java)
        at java.lang.Exception.<init>(Exception.java)
        at java.lang.RuntimeException.<init>(RuntimeException.java)
        at java.lang.SecurityException.<init>(SecurityException.java)
        at sun.applet.AppletSecurityException.<init>(AppletSecurityException.java:36)
        at sun.applet.AppletSecurity.checkConnect(AppletSecurity.java:299)
        at sun.applet.AppletSecurity.checkConnect(AppletSecurity.java:271)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:100)
        at sun.net.www.http.HttpClient.get(HttpClient.java:225)
        at sun.net.www.http.HttpClient.handleUrl(HttpClient.java:423)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:452)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:56)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:124)
        at java.net.URL.openStream(URL.java)
        at WhiteBoard.start(WhiteBoard.java:18)
        at sun.applet.AppletPanel.run(AppletPanel.java:268)
        at java.lang.Thread.run(Thread.java)
 
here is my program :                          
 
import java.applet.Applet;
import java.net.URL;
import java.io.InputStream;
import java.io.File;
import java.io.FileOutputStream;
 
public class WhiteBoard extends Applet {
 
        String StrUrl;
        URL  Nurl;
        public void init() {
                StrUrl = getParameter("pt");
                }
 
        public void start() {
 
                Nurl = new URL(StrUrl);
                InputStream is = Nurl.openStream();
                int cpt = is.read();
                File f = new File("/usr/tmp","AppLigne.html");
                FileOutputStream fis = new FileOutputStream(f);
                while (cpt != -1) {
                        fis.write(cpt);
                        cpt = is.read();
                        }
                }
} 

here is my program :                          
 
import java.applet.Applet;
import java.net.URL;
import java.io.InputStream;
import java.io.File;
import java.io.FileOutputStream;
 
public class WhiteBoard extends Applet {
 
        String StrUrl;
        URL  Nurl;
        public void init() {
                StrUrl = getParameter("pt");
                }
 
        public void start() {
 
                Nurl = new URL(StrUrl);
                InputStream is = Nurl.openStream();
                int cpt = is.read();
                File f = new File("/usr/tmp","AppLigne.html");
                FileOutputStream fis = new FileOutputStream(f);
                while (cpt != -1) {
                        fis.write(cpt);
                        cpt = is.read();
                        }
                }
} 

Please suggest what I am doing wrong.

Thanks.

-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post