JDK-8028691 : loading browser proxy via config script should not trigger JAR download
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 7u51
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-11-20
  • Updated: 2014-07-17
  • Resolved: 2014-02-21
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 7 JDK 8 JDK 9
7u55Fixed 8u11Fixed 9Fixed
Related Reports
Duplicate :  
Duplicate :  
Description
while investigating jdk-8028530, I noticed a problem where proxy lookup trigger JAR download, which seems incorrect:

java.lang.Exception: Stack trace
	at java.lang.Thread.dumpStack(Unknown Source)
	at com.sun.deploy.net.HttpDownloadHelper.download(HttpDownloadHelper.java:101)
	at com.sun.deploy.cache.Cache.downloadResourceToTempFile(Cache.java:690)
	at com.sun.deploy.cache.Cache.downloadResourceToCache(Cache.java:653)
	at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
	at com.sun.deploy.net.DownloadEngine.downloadResource(Unknown Source)
	at com.sun.deploy.cache.ResourceProviderImpl.getResource(ResourceProviderImpl.java:266)
	at com.sun.deploy.cache.ResourceProviderImpl.getResource(ResourceProviderImpl.java:220)
	at sun.plugin2.applet.JNLP2ClassLoader$2.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.plugin2.applet.JNLP2ClassLoader.getJarFile(Unknown Source)
	at com.sun.jnlp.JNLPCachedJarURLConnection.connect(Unknown Source)
	at com.sun.jnlp.JNLPCachedJarURLConnection.getJarFile(Unknown Source)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(DeployURLClassPath.java:812)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(DeployURLClassPath.java:727)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(DeployURLClassPath.java:764)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(DeployURLClassPath.java:758)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(DeployURLClassPath.java:747)
	at com.sun.deploy.security.DeployURLClassPath$3.run(DeployURLClassPath.java:432)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.deploy.security.DeployURLClassPath.getLoader(DeployURLClassPath.java:421)
	at com.sun.deploy.security.DeployURLClassPath.getLoader(DeployURLClassPath.java:396)
	at com.sun.deploy.security.DeployURLClassPath.access$000(DeployURLClassPath.java:65)
	at com.sun.deploy.security.DeployURLClassPath$1.next(DeployURLClassPath.java:284)
	at com.sun.deploy.security.DeployURLClassPath$1.hasMoreElements(DeployURLClassPath.java:296)
	at java.net.URLClassLoader$3$1.run(Unknown Source)
	at java.net.URLClassLoader$3$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader$3.next(Unknown Source)
	at java.net.URLClassLoader$3.hasMoreElements(Unknown Source)
	at sun.misc.CompoundEnumeration.next(Unknown Source)
	at sun.misc.CompoundEnumeration.hasMoreElements(Unknown Source)
	at sun.misc.Service$LazyIterator.hasNext(Unknown Source)
	at javax.script.ScriptEngineManager.initEngines(Unknown Source)
	at javax.script.ScriptEngineManager.access$000(Unknown Source)
	at javax.script.ScriptEngineManager$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.script.ScriptEngineManager.init(Unknown Source)
	at javax.script.ScriptEngineManager.<init>(Unknown Source)
	at com.sun.deploy.net.proxy.SunAutoProxyHandler.getProxyInfo(SunAutoProxyHandler.java:68)
	at com.sun.deploy.net.proxy.DynamicProxyManager.getProxyList(DynamicProxyManager.java:79)
	at com.sun.deploy.net.proxy.DeployProxySelector.select(DeployProxySelector.java:165)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
	at com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:171)
	at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(BasicHttpRequest.java:54)
	at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
	at com.sun.deploy.net.DownloadEngine.downloadResource(Unknown Source)
	at com.sun.deploy.cache.ResourceProviderImpl.getResource(ResourceProviderImpl.java:266)
	at com.sun.deploy.cache.ResourceProviderImpl.getResource(ResourceProviderImpl.java:220)
	at sun.plugin2.applet.JNLP2ClassLoader$2.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.plugin2.applet.JNLP2ClassLoader.getJarFile(Unknown Source)
	at com.sun.jnlp.JNLPCachedJarURLConnection.connect(Unknown Source)
	at com.sun.jnlp.JNLPCachedJarURLConnection.getJarFile(Unknown Source)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(DeployURLClassPath.java:812)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(DeployURLClassPath.java:727)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(DeployURLClassPath.java:764)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(DeployURLClassPath.java:758)
	at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(DeployURLClassPath.java:747)
	at com.sun.deploy.security.DeployURLClassPath$3.run(DeployURLClassPath.java:432)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.deploy.security.DeployURLClassPath.getLoader(DeployURLClassPath.java:421)
	at com.sun.deploy.security.DeployURLClassPath.getLoader(DeployURLClassPath.java:396)
	at com.sun.deploy.security.DeployURLClassPath.access$000(DeployURLClassPath.java:65)
	at com.sun.deploy.security.DeployURLClassPath$1.next(DeployURLClassPath.java:284)
	at com.sun.deploy.security.DeployURLClassPath$1.hasMoreElements(DeployURLClassPath.java:296)
	at java.net.URLClassLoader$3$1.run(Unknown Source)
	at java.net.URLClassLoader$3$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader$3.next(Unknown Source)
	at java.net.URLClassLoader$3.hasMoreElements(Unknown Source)
	at sun.misc.CompoundEnumeration.next(Unknown Source)
	at sun.misc.CompoundEnumeration.hasMoreElements(Unknown Source)
	at sun.misc.CompoundEnumeration.next(Unknown Source)
	at sun.misc.CompoundEnumeration.hasMoreElements(Unknown Source)
	at sun.misc.Service$LazyIterator.hasNext(Unknown Source)
	at javax.script.ScriptEngineManager.initEngines(Unknown Source)
	at javax.script.ScriptEngineManager.access$000(Unknown Source)
	at javax.script.ScriptEngineManager$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.script.ScriptEngineManager.init(Unknown Source)
	at javax.script.ScriptEngineManager.<init>(Unknown Source)
	at com.sun.deploy.net.proxy.SunAutoProxyHandler.getProxyInfo(SunAutoProxyHandler.java:68)
	at com.sun.deploy.net.proxy.DynamicProxyManager.getProxyList(DynamicProxyManager.java:79)
	at com.sun.deploy.net.proxy.DeployProxySelector.select(DeployProxySelector.java:165)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
	at com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:171)
	at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(BasicHttpRequest.java:54)
	at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
	at com.sun.deploy.net.DownloadEngine.downloadResource(Unknown Source)
	at com.sun.deploy.cache.ResourceProviderImpl.getResource(ResourceProviderImpl.java:266)
	at com.sun.deploy.cache.ResourceProviderImpl.getResource(ResourceProviderImpl.java:220)
	at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Comments
SQE OK to take the fix into CPU14_02
24-02-2014

fix is in 7u-cpu and 8u-cpu deploy sandbox. started a build, build dated with Feb 21 will contain the fix.
21-02-2014

I think we should re-consider this for 14_02. Fix is ready and we seen various duplicate of the issue already. 8u-cpu direct backport: https://java.se.oracle.com/code/cru/CR-JDK8UCPU-61
21-02-2014

crucible: https://java.se.oracle.com/code/cru/CR-JDK9CLIENT-24
15-02-2014

SQE OK to defer the fix.
16-01-2014

Agree to defer.
14-01-2014

request to defer from 7u55 to July CPU: P3 issue not a showstopper for 7u55. - problem reproduced only when using DT + webstart apps with applet-desc + use of embedded jnlp with jnlp_content param - jnlp_content option is not default used by javafxpackager or ant tasks. - workaround available: not use the jnlp_content option; or switch to use manual proxy settings
08-01-2014

SQE OK to defer the fix to CPU14_02
01-12-2013

I do not know exactly which fix yet. But I see the problem with 7u51 b01 too.
25-11-2013

7u51-defer-request: - problem reproduced only when using DT + webstart apps with applet-desc + use of embedded jnlp with jnlp_content param - jnlp_content option is not default used by javafxpackager or ant tasks. - workaround available: not use the jnlp_content option; or switch to use manual proxy settings
23-11-2013

webrev: http://javaweb.us.oracle.com/~tvng/webrevs/8028691/webrev/
23-11-2013

ILW=HLM=P3
22-11-2013

jnlp_content option is not default used by javafxpackager or ant tasks.
22-11-2013

I can reproduce with any fx webstart apps (applet-desc), as long as it's deployed with dt and jnlp_content: http://jfx.us.oracle.com/hudson/view/2.2.51/job/2.2.51/label=windows-i586-14/lastSuccessfulBuild/artifact/artifacts/deployed/ with your browser to auto config with http://wpad.us.oracle.com/wpad.dat. you need to clear the cache before launching the webstart apps. it only happens on first launch. subsequent launch works. also, you need to lower security level to medium or use exception site list, because these samples are unsigned.
22-11-2013

another workaround is to not use jnlp_content (embedded JNLP in html): http://javaweb.us.oracle.com/~tvng/8028691/testCheckProperty_JNLP.html
22-11-2013

problem exists since 7u51 b01. The above simple fix will fix the problem. Still investigating what caused the regression though.
22-11-2013

problem is due to this code in com.sun.deploy.net.proxy.SunAutoProxyHandler ScriptEngineManager manager = new ScriptEngineManager(); This will cause the context class loader of the thread to be used to lookup the ScriptEngine impl class. In this case, the context class loader is the jnlp class loader - that's why it tries to trigger app jar download. I believe we should always use ScriptEngineManager(null) - we should always use the the script engine factories that are bundled with the platform.
21-11-2013

testcase: lower to medium security level, clear cache, setup browser to use wpad auto config proxy script and JCP use browser proxy, and then load: http://stt-13.ru.oracle.com/export/home0/tmp/felix/reproduce/JDK-8028530/html/testCheckProperty_JNLP.html
20-11-2013

7u45 works fine. Looks like it's regression introduced in 7u51.
20-11-2013

workaround is do not use dynamic proxy settings.
20-11-2013