Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-09-2007, 02:29 PM
Member
 
Join Date: Aug 2007
Posts: 7
Rep Power: 0
Simmy is on a distinguished road
Default 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
  #2 (permalink)  
Old 08-09-2007, 03:04 PM
levent
Guest
 
Posts: n/a
Default
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
Rep Power: 0
Simmy is on a distinguished road
Default
how do i signed my applet?
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 08-09-2007, 05:15 PM
levent
Guest
 
Posts: n/a
Default
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
Rep Power: 0
Simmy is on a distinguished road
Default
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
levent
Guest
 
Posts: n/a
Default
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
Rep Power: 0
Simmy is on a distinguished road
Default
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
Rep Power: 0
Simmy is on a distinguished road
Default
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
Reply

Bookmarks

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

BB 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 +2. The time now is 12:00 AM.



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