JDK-6481004 : SplashScreen.getSplashScreen() fails in Web Start context
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-10-12
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
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
6u1Fixed 7 b03Fixed
Related Reports
Relates :  
Description
I have an existing application that uses the new SplashScreen API added in JDK 6.
I tried to migrate it from a standalone app to a Java Web Start app, and ran into
the following exception:

----
java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.splashscreen)
	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.checkLink(SecurityManager.java:818)
	at java.lang.Runtime.loadLibrary0(Runtime.java:817)
	at java.lang.System.loadLibrary(System.java:1030)
	at java.awt.SplashScreen.getSplashScreen(SplashScreen.java:91)
	at SSTest.main(SSTest.java:5)
	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:1205)
	at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1151)
	at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:998)
	at com.sun.javaws.Launcher.run(Launcher.java:105)
	at java.lang.Thread.run(Thread.java:619)
----

Since Java Web Start is now using the new SplashScreen API under the hood, I would
expect to be able to add a splash screen to my webstarted app via:
    <icon kind="splash" href="splash.png"/>
and then add a progress bar or something similar to that splash screen using the
new JDK 6 APIs.  (If my expectation is incorrect, then we should at least return
null from getSplashScreen(); this exception is obviously not the correct behavior.
But I see no reason why the SplashScreen stuff shouldn't work in a Web Start
scenario.)

To reproduce:
1. Place the attached files in the /tmp directory.
2. cd /tmp
3. javaws SSTest.jnlp

Comments
SUGGESTED FIX --- SplashScreen.java Thu Oct 12 14:57:57 2006 *************** *** 90,96 **** } // SplashScreen class is now a singleton if (!wasClosed && theInstance == null) { ! System.loadLibrary("splashscreen"); long ptr = _getInstance(); if (ptr != 0 && _isVisible(ptr)) { theInstance = new SplashScreen(ptr); --- 90,97 ---- } // SplashScreen class is now a singleton if (!wasClosed && theInstance == null) { ! java.security.AccessController.doPrivileged( ! new sun.security.action.LoadLibraryAction("splashscreen")); long ptr = _getInstance(); if (ptr != 0 && _isVisible(ptr)) { theInstance = new SplashScreen(ptr);
12-10-2006

EVALUATION The following code in SplashScreen.getSplashScreen() needs to be in a doPrivileged() block: System.loadLibrary("splashscreen");
12-10-2006