Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWTPermission Exception while implementing Automatic update desktop application using java web start

I am working in a Desktop application that provides Online Backup of data. In my application i am trying to implement automatic software update feature. For this i am using java web start. I have done the following process for using java web start.

1> created jar with all resources. 2> created jnlp file as :

      <?xml version="1.0" encoding="UTF-8"?>
     <jnlp spec="1.0+" 
               codebase="http://cmswebusa.com/kapil"
              href="PixelVaultJNLP.jnlp">
                <information>
                        <title>PixelVault</title>
                          <vendor>globussoft</vendor>
                           </information>
                        <resources>
                     <!-- Application Resources -->       
                          <jar href="PixelVault.jar" main="true" />

                     </resources>
                   <application-desc
                   name="PixelVault"
                   main-class="com.pixelvault.systemtray.SysTray">
                   </application-desc>
                   <update check="background"/>
                </jnlp>

where PixelVault.jar is jar of the application which is on http server location.

while i am trying to download my application using command prompt run option by typing : javaws , i am getting AWT Permission Exception as:

java.security.AccessControlException: access denied "java.awt.AWTPermission"

it says "java.awt.AWTPermissionException""accessSystemTray". I am not getting how can i allow my application to use system tray.

Please guide to make changes in jnlp file or making any other change in my application.

I thanks to your all valuable suggestions that will help me to solve this problem.

like image 230
Toman Avatar asked Oct 21 '10 15:10

Toman


1 Answers

To get rid of that error:

  • The JNLP will need to declare all-permissions within a security element.
  • The code will need to be digitally signed.

Note that the JNLP file has elements out of the correct order. Use JaNeLA to check the validity of the file as well as other aspects of the launch.

like image 101
Andrew Thompson Avatar answered Sep 29 '22 09:09

Andrew Thompson