java - JNLP isn't cooperating JFileChooser Access Denied -
i feel dumb......
so writing java app, , if can me work you'll able see it.
so jar file here: http://team2648.com/otis2/admin/omninode2.8.jar
i able used java web-start application, following tutorial here: http://download.oracle.com/javase/tutorial/deployment/webstart/deploying.html
so wrote following jnlp file directed:
<?xml version="1.0" encoding="utf-8"?> <jnlp spec="1.0+" codebase="http://team2648.com/otis2/admin" href="test.jnlp"> <information> <title>omninode mapper</title> <vendor>techplex engineer</vendor> </information> <resources> <!-- application resources --> <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/> <jar href="omninode2.8.jar" main="true" /> </resources> <application-desc name="omninode mapper" main-class="omninode28.driver" width="300" height="300"> </application-desc> <update check="background"/> </jnlp>
but you'll see if download jnlp http://team2648.com/otis2/admin/test.jnlp
, run it, following error(on pc):
access denied (java.io.filepermission c:\users\myusername\documents read)
exception
java.security.accesscontrolexception: access denied (java.io.filepermission c:\users\techplex engineer\documents read)
@ java.security.accesscontrolcontext.checkpermission(unknown source)
@ java.security.accesscontroller.checkpermission(unknown source)
@ java.lang.securitymanager.checkpermission(unknown source)
@ java.lang.securitymanager.checkread(unknown source)
@ java.io.file.exists(unknown source)
@ java.io.win32filesystem.canonicalize(unknown source)
@ java.io.file.getcanonicalpath(unknown source)
@ sun.awt.shell.win32shellfoldermanager2.createshellfolder(unknown source)
@ sun.awt.shell.win32shellfoldermanager2.getpersonal(unknown source)
@ sun.awt.shell.win32shellfoldermanager2.get(unknown source)
@ sun.awt.shell.shellfolder.get(unknown source)
@ javax.swing.filechooser.filesystemview.getdefaultdirectory(unknown source)
@ javax.swing.jfilechooser.setcurrentdirectory(unknown source)
@ javax.swing.jfilechooser.(unknown source)
@ javax.swing.jfilechooser.(unknown source)
at omninode28.nodepanel.(nodepanel.java:61)
at omninode28.editpanel.(editpanel.java:31)
at omninode28.driver.main(driver.java:25)
@ sun.reflect.nativemethodaccessorimpl.invoke0(native method)
@ sun.reflect.nativemethodaccessorimpl.invoke(unknown source)
@ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source)
@ java.lang.reflect.method.invoke(unknown source)
@ com.sun.javaws.launcher.executeapplication(unknown source)
@ com.sun.javaws.launcher.executemainclass(unknown source)
@ com.sun.javaws.launcher.dolaunchapp(unknown source)
@ com.sun.javaws.launcher.run(unknown source)
@ java.lang.thread.run(unknown source)
so files points at:
this line: fc = new jfilechooser();
so leads me believe need ask user permission write system.
i befuddled. super, thanks
edit... should make users download jar directly? pros cons?
you have sign jars , grant permission classes adding snippet jnlp:
<security> <all-permissions/> </security>
Comments
Post a Comment