JDK-7156268 : app is stuck when launching with javaagent if there is no jre info in deployment.properties
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 8,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: generic
  • Submitted: 2012-03-23
  • Updated: 2016-01-14
  • Resolved: 2015-10-19
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.
8u72Fixed 9 b92Fixed
Related Reports
Duplicate :  
Relates :  
test env: jre8 b29, 32bit winxp

For code coverage purpose, we need to pass some vars to jvm when launching app.
But I found if there is no deployment.properties file, it will be stuck in
"C:\Program Files\Java\jre8\bin\javaw.exe" -classpath "C:\\Program Files\\Java\\jre8\\lib\\deploy.jar" com.sun.deploy.panel.JreLocator

Steps to reproduce:
1) rdp to leexlee.cn.oracle.com qgong/hello
2) delete the deployment.properties file if it exists
3) cd to dir L:/tmp, then execute
java ProcessBuilderTest
This app launches a jnlp with ProcessBuilder and pass _JAVA_OPTIONS with -javaagent value to it.
4) if the app can't be lauched and
ps -ef | grep java, shows that it gets stuck in
"C:\Program Files\Java\jre8\bin\javaw.exe" -classpath "C:\\Program Files\\Java\\jre8\\lib\\deploy.jar" com.sun.deploy.panel.JreLocator
the issue is reproduced.

if we launch any jnlp application before running ProcessBuilderTest to create a deployment.properties file, the app can be launched successfully.

Source code has been attached,
it uses jcov.jar in http://rehte.cn.oracle.com:8080/wshost/new_framework/new_framework/CodeCoverage/lib/jcov.jar
You can download the jcov.jar file, modify the path in ProcessBuilderTest.java and try it on your machine.

for JDK9 we just stop updating list of jres from registry in native code. Crucible review: https://java.se.oracle.com/code/cru/CR-JDK9CLIENT-1432 need to investigate if we can do the same in 8u or not.

my mistake - the removal of com.sun.deploy.panel package was not until b85, and it is possible for the native code to still call JreLocator in deploy.jar. Since b85 it uses the old non-existant class com.sun.deploy.panel.JreLocator. This needs to be fixed, there should be no reason for javaws native code to get the platform and product version of a jre, since it no longer writes out the deployment.properties file, and doesnt make any decisions as to which jre to use.

Double checked, there is com/sun/deploy/panel/JreLocator.class in jre9 b83's lib/deploy.jar, pls see L:\tmp>c:\jdk8_32\bin\jar -tf c:\PROGRA~2\Java\JRE19~1.0\lib\deploy.jar | grep J reLoca com/sun/deploy/panel/JreLocator.class In ProcessBuilderTest, it just sets -javaagent env and launches the application, see http://rehte.cn.oracle.com:8080/wshost/tmp/ProcessBuilderTest.java From the PID and PPID, the process of JreLocator is from javaws L:\tmp>ps -ef | grep java qgong 1076 5104 0 10:57:17 con 0:00 c:\PROGRA~2\Java\JRE19~1.0\bin\javaws http://nicole1.us.oracle.com:8080/JavawsMustangIntegTest/downloadService2/getCachedResource_JARV1.jnlp qgong 2316 1076 0 10:57:17 con 0:00 "c:\PROGRA~2\Java\JRE19~1.0\bin\javaw.exe" -classpath "c:\PROGRA~2\Java\JRE19~1.0\lib\deploy.jar" com.sun.deploy.panel.JreLocator

Still can reproduce it with jre9 b83. if just executing "C:\Program Files (x86)\Java\jre1.9.0\bin\java.exe" -classpath "C:\\Program Files (x86)\\Java\\jre1.9.0\\lib\\deploy.jar" com.sun.deploy.panel.JreLocator, it will not be stuck. If you execute ProcessBuilderTest, it can be reproduced. In it, it sets javaagent before starting a process to launch javaws app.

since you say you can reproduce this with JDK9 b83. and the native code in javaws in JDK9 does not call : "java.exe" -classpath ... .../JreLocator", and even jre9 does not have a com.sun.deploy.panel package, I suspect the problem is not in javaws but in ProcessBuilderTest before it even invokes javaws.

even with JDK8, the command: "C:\Program Files (x86)\Java\jre8\bin\java.exe" -classpath "C:\\Program Files (x86)\\Java\\jre8\\lib\\deploy.jar" com.sun.deploy.panel.JreLocator works as expected whether there is a deployment.properties file or not. tried both b32 and latest b132

this may be related to JDK-8129223, since problem is when the command: "javaw.exe -classpath deploy.jar com.sun.deploy.panel.JreLocator" is invoked, but in this case, the jre being called is the current latest installed one. I can't reproduce this directly with 8u60. If I delete deployment.properties file then run command: "C:\Program Files (x86)\Java\jre1.8.0_60\bin\java.exe"-classpath "C:\\Program Files (x86)\\Java\\jre1.8.0_60\\lib\\deploy.jar" com.sun .deploy.panel.JreLocator it works as expected, out puting: platformVersion=1.8 productVersion=1.8.0_60-internal will try the same with 1.8.0