During regression testing of the fix for 6676489, it was discovered that the speed-trap.com dashboard was broken with the fix for 6668033, in which a level of indirection was added to the JnlpLookupStub to delegate through the current JNLP class loader / JNLPClassLoaderIf. It turns out the speed-trap applet tries to call into the JNLP services and expects either that ClassNotFoundException will be thrown, or that a query to fetch a given service will return null. Throwing SecurityException breaks their applet. Currently the following NullPointerException is thrown, which also breaks their applet:
java.lang.NullPointerException
at com.sun.jnlp.JnlpLookupStub.findService(JnlpLookupStub.java:45)
at com.sun.jnlp.JnlpLookupStub.access$000(JnlpLookupStub.java:18)
at com.sun.jnlp.JnlpLookupStub$1.run(JnlpLookupStub.java:25)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.jnlp.JnlpLookupStub.lookup(JnlpLookupStub.java:22)
at javax.jnlp.ServiceManager.lookup(ServiceManager.java:42)
at com.speed_trap.applet.JNLPBridgeImpl.getJNLPCodeBase(Unknown Source)
at com.speed_trap.data.olap.CodeBaseCategoryResourceProvider.getInstance(Unknown Source)
at com.speed_trap.dashboard.DataAccessorApplet.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:2582)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1189)
at java.lang.Thread.run(Thread.java:619)
We need to fail more gracefully. The best solution appears to be to simply return null from the JnlpLookupStub if there's no current JNLPClassLoaderIf.
Yes, the JNLP lookup shall just return NULL,
if the service is not available - due to the spec.