JDK-6710203 : Regression: JavaWS can not launch JDK 142 app from command line
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 6u10
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-06-03
  • Updated: 2010-09-17
  • Resolved: 2008-09-25
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
6u10 b31Fixed 7Fixed
Description
J2SE Version (please include all output from java -version flag):

java version "1.6.0_10-beta"
Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b24)
Java HotSpot(TM) Client VM (build 11.0-b12, mixed mode, sharing)


Does this problem occur on J2SE 1.3, 1.4.x or 1.5?  Yes / No (pick one)

No


Operating System Configuration Information (be specific):
Windows XP Service Pack 2


Hardware Configuration Information (be specific):
Standard Windows desktop hardware, freshly installed which means that c:\windows\system32 does not contains a copy of msvcr71.dll

Bug Description:

Java Webstart 6u10 beta does not able to launch JDK 1.4.2 based application from the command line. This is due to the fact that Java Webstart cannot find the copy of msvcr71.dll as 1.4.2 does not come with a copy.


Steps to Reproduce (be specific):

Create a sample JNLP with j2se version set to 1.4* tag - I have included one that uses SwingSet2:


<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="$$codebase" href="$$name">
		<information>
		<title>SwingSet2</title>
		<vendor>Sun Microsystem</vendor>
		<homepage href="http://java.sun.com"/>
		<description>JNLP Test - SwingSet2 </description>
		<description kind="short">JNLP Test - SwingSet2</description>
	</information>
	<resources>
		<j2se version="1.4*" initial-heap-size="32m" max-heap-size="64m"/>
		<jar href="$$context/jars/SwingSet2.jar" main="true"/>
	</resources>
	<application-desc main-class="SwingSet2"/>
</jnlp>


When you deploy this to a web server and run this using Java Webstart command line:

"c:\Program Files\Java\jre6\bin\javaws.exe" http://server:9394/jnlp/SwingSet2.1.4-STAR.jnlp

Nothing will appear and a javaw process will be stuck there. 

The launch will work if copy msvcr71.dll into 1.4.2 installation directory.

Comments
EVALUATION The reason why it is only failing when launching from dos prompt is due to the way windows setup the search path. We setup the windows registry key: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\javaws.exe\Path to point to jre bin directory. When javaws is invoke via the explorer, the above Path is always added to the windows PATH environment variable value for the process. That's why msvcr71.dll can be found in these cases. However, when javaws.exe is invoked via the command prompt, the above Path is not added by windows. That's why we only see the problem via the command prompt. If you launch via command prompt and you are in the jre6\bin directory, it works because the current directory will always be searched. Our code in launcher_md.c, function LauncherSetup_md actually tries to prevent this problem by always adding the jre6\bin directory to the PATH, however we can adding the extra quote to the PATH, which causes it to fail. Apparently, nothing should be quoted in the PATH env variable for windows. I will file a separate bug for this issue. Anyway, I believe we have the correct fix for this, which is to preload msvcr71.dll before loading deploy.dll.
17-06-2008

EVALUATION it's only happening when Java Web Start is launching from a dos prompt, which is not the most common scenario. The same scenario will work when launching from browser, java cache viewer, or from the application shortcuts created by java web start.
16-06-2008

WORK AROUND In a dos prompt, a workaround is to "cd" to the jre6\bin directory first, and then launching the command will work.
16-06-2008

EVALUATION Problem is deploy.dll is linking to msvcr71.dll. (dumpbin /IMPORTS deploy.dll) java.lang.UnsatisfiedLinkError: getPlatformUserHomeImpl > at com.sun.deploy.config.WinConfig.getPlatformUserHomeImpl(Native Method > ) > at com.sun.deploy.config.WinConfig.getPlatformUserHome(WinConfig.java:66 > ) > at com.sun.deploy.config.Config.<clinit>(Config.java:716) > at com.sun.javaws.Main.continueInSecureThread(Main.java:120) > at com.sun.javaws.Main$1.run(Main.java:107) > at java.lang.Thread.run(Unknown Source) problem exists in Java 6.0 as well. also, it can only be reproduced from the command line. launching from browser works.
05-06-2008