JDK-6892898 : AccessControlException in IntegrationService.requestAssociation() on Ubuntu Linux
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 6u18
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2009-10-19
  • Updated: 2010-09-16
  • Resolved: 2010-01-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u18 b05Fixed 7Fixed
Description
When calling IntegrationService.requestAssociation() on Linux using the following testcase:

http://sqindia.india.sun.com/disk01/raghu/TestSpec/TestCases/RequestAssociationMimeFileExtn.jnlp

You will get an AccessControlException:

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.sun.javaws.Launcher.executeApplication(Launcher.java:1664)
	at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1610)
	at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1415)
	at com.sun.javaws.Launcher.run(Launcher.java:127)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ExceptionInInitializerError
	at com.sun.deploy.association.utility.AppAssociationWriterFactory.newInstance(AppAssociationWriterFactory.java:16)
	at com.sun.deploy.association.AssociationService.<init>(AssociationService.java:67)
	at com.sun.javaws.UnixInstallHandler.unregisterAssociationInternal(UnixInstallHandler.java:138)
	at com.sun.jnlp.IntegrationServiceImpl.removeAssociation(IntegrationServiceImpl.java:148)
	at is05.RequestAssociationMimeFileExtn.<init>(RequestAssociationMimeFileExtn.java:16)
	at is05.RequestAssociationMimeFileExtn.main(RequestAssociationMimeFileExtn.java:30)
	... 9 more
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read)
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
	at java.security.AccessController.checkPermission(AccessController.java:546)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
	at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1285)
	at java.lang.System.getProperty(System.java:650)
	at com.sun.deploy.association.utility.GnomeAppAssociationWriter.<clinit>(GnomeAppAssociationWriter.java:53)
	... 15 more

Comments
EVALUATION Need to call internal API through AccessController.doPrivileged(), we don't want to bother client code with internals.
19-10-2009