Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-09-2007, 02:29 PM
Member
 
Join Date: Aug 2007
Posts: 7
Simmy is on a distinguished road
Help with error message when running JAR via HTML file
when i run my jar using html code it doesn't show anything... i checked the java console and the error i read was...

Quote:
java.security.AccessControlException: access denied (java.io.FilePermission book0.jpg read)
at java.security.AccessControlContext.checkPermission (Unknown Source)
at java.security.AccessController.checkPermission(Unk nown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
at sun.awt.SunToolkit.getImage(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at BookMall.init(BookMall.java:63)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.security.AccessControlException: access denied (java.io.FilePermission book0.jpg read)
at java.security.AccessControlContext.checkPermission (Unknown Source)
at java.security.AccessController.checkPermission(Unk nown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
at sun.awt.SunToolkit.getImage(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at BookMall.init(BookMall.java:63)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
i do use imageicon and it displays properly on my gui... but when i convert to japplet it gives all sort of error. what am i doing wrongly?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-09-2007, 03:04 PM
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
If book0.jpg is not on the same machine where the applet resides, you can not reach it. You just can not reach it from you applet. To access local file system of the user, you need to sign your applet..
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-09-2007, 05:05 PM
Member
 
Join Date: Aug 2007
Posts: 7
Simmy is on a distinguished road
how do i signed my applet?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 08-09-2007, 05:15 PM
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
Try searching on google. There are several resources to read. One of them is below:

How to sign an applet (and get it to work)
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 08-09-2007, 05:43 PM
Member
 
Join Date: Aug 2007
Posts: 7
Simmy is on a distinguished road
ok i signed it sucessfully... the applet is showing.. but my image is not... i'm using
Quote:
picture = new JLabel();
picture.setBorder(BorderFactory.createEtchedBorder (EtchedBorder.RAISED));
picture.setIcon(new ImageIcon(new ImageIcon("book0.jpg").getImage());
getContentPane().add(picture, BorderLayout.EAST);
what could be the problem?
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 08-09-2007, 05:47 PM
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
Getting same error?
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 08-09-2007, 05:57 PM
Member
 
Join Date: Aug 2007
Posts: 7
Simmy is on a distinguished road
no there is no error... the gui is showed in the Firefox now... but the picture ain't showing... and i can't look at the console.
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 08-12-2007, 04:47 PM
Member
 
Join Date: Aug 2007
Posts: 7
Simmy is on a distinguished road
ok i found out that it will only work with IE... and when i place all the picture files on my desktop... is there a way to make it load the picture from it's current directory?(i mean the jar directory).
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error while running jar file ernieBob NetBeans 1 03-25-2008 12:13 PM
java error message baileyr New To Java 2 01-23-2008 04:47 AM
Strange error message "Source not found" ppayal Eclipse 0 11-25-2007 07:19 PM
how to call a JAR FILE from HTML leonard Java Applets 1 08-05-2007 07:06 AM
error message on jsp sandor Web Frameworks 1 04-11-2007 03:10 AM


All times are GMT +3. The time now is 04:47 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org