File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Problem putting applet on Web page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Problem putting applet on Web page" Watch "Problem putting applet on Web page" New topic
Author

Problem putting applet on Web page

maja neskovic
Ranch Hand

Joined: Apr 28, 2010
Posts: 134
Hello!

I have a problem with putting the applet on Web page. I wrote this code:



This error occures:

java.security.AccessControlException: access denied (java.net.SocketPermission www.wolflodge.org:80 connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at javax.imageio.ImageIO.read(Unknown Source)
at org.me.test.Simulacija.init(Simulacija.java:48)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Help, please
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42950
    
  70
Is the applet served from www.wolflodge.org? If not, then it can't access that host for security reasons. See HowCanAnAppletReadFilesOnTheLocalFileSystem for more information and workarounds.
maja neskovic
Ranch Hand

Joined: Apr 28, 2010
Posts: 134
No, I wan't to run it localy... Thanks for link, I'll try to do signing
maja neskovic
Ranch Hand

Joined: Apr 28, 2010
Posts: 134
Is it maybe easier way for me to put it in www.wolflodge.org?

Can you, please, tell mi how to do it?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18992
    
    8

If you control that web site, then sure, just put the applet into one of its pages. But if it's somebody else's web site, I'm sure you can see that you can't just go changing somebody else's web site. You could ask them if they would put your applet into one of their pages, but I can't imagine why they would do that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem putting applet on Web page