United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6710203 Regression: JavaWS can not launch JDK 142 app from command line
JDK-6710203 : Regression: JavaWS can not launch JDK 142 app from command line

Details
Type:
Bug
Submit Date:
2008-06-03
Status:
Closed
Updated Date:
2010-09-17
Project Name:
JDK
Resolved Date:
2008-09-25
Component:
deploy
OS:
windows_xp
Sub-Component:
webstart
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u10
Fixed Versions:
6u10 (b31)

Related Reports
Backport:

Sub Tasks

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

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.
                                     
2008-06-05
WORK AROUND

In a dos prompt, a workaround is to "cd" to the jre6\bin directory first, and then launching the command will work.
                                     
2008-06-16
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.
                                     
2008-06-16
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.
                                     
2008-06-17



Hardware and Software, Engineered to Work Together