Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-02-2009, 11:56 AM
Member
 
Join Date: Nov 2008
Posts: 2
Rep Power: 0
ConvoyTh is on a distinguished road
Question Signed Applet to write on LPT1 port - permission error
Hi,
I have a simple applet based on this code:
Code:
import java.awt.*;
import java.applet.*;
import java.util.*;
import java.io.*;
 
public class TestJavaXp extends Applet{
	int i = 0;
	String s = "Print this text";
	    try {
		FileWriter out = new FileWriter("LPT1");
		out.write(s);	
		out.flush();
		out.close();      
		}
	    catch (IOException e) {
		e.printStackTrace();
		}
}

I signed the applet, I accepted the certification pop-up, but I receive this error:
uncaught exception: Error calling method on NPObject!
[plugin exception: java.security.AccessControlException: access denied (java.ioFilePermission LPT1 write)]


It works perfectly only if I grant permissions in the java.policies file, but I can't always do it of course.

Why?
I've no problem signing applets that write files on disk, I've troubles only with LPT1 port but I need it.
I tried different browsers (Firefox 3, Chrome 2, IE7).

Can anyone help me?

Thanks.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Tags
accesscontrolexception, java.io, lpt1, print, sign

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
'Permission denied' java script error java08 JavaServer Pages (JSP) and JSTL 0 04-13-2009 09:19 AM
how to write to parallel port? gen1mx6 NetBeans 1 01-08-2009 11:10 PM
[SOLVED] signed applet, or what AXH Java Applets 2 10-10-2008 02:28 AM
run java signed applet in vista nanaji Java Applets 7 05-14-2008 12:59 PM
.jnlp cant read & write on browser despite signed .jar bongia New To Java 0 11-14-2007 07:04 PM


All times are GMT +2. The time now is 06:03 AM.



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