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

1

6

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.

Distribution answered 21/10, 2010 at 15:11 Comment(0)
P
2

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.

Pahl answered 21/10, 2010 at 23:45 Comment(2)
Thanks for answering my question but i am having another problem with digital signature. i am following the process maintioned by wiki.plexinfo.net/index.php?title=How_to_sign_JAR_files and in the step 5> sign the JAR file with the test certificate i am getting error jarsigner: unable to open jar file: cmswebusa.com/kapil/PixelVault.jar. Is there any way to check what can be the reason for this error. Please guide me for this.Distribution
The message suggests that you are attempting to sign a Jar file that is already on the net. To be successful, the Jar must be on the local file system. Sign it there, then upload it.Pahl

© 2022 - 2024 — McMap. All rights reserved.