United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6646617 Dropping a file on a Java Web Start desktop symbol DELETES the file
JDK-6646617 : Dropping a file on a Java Web Start desktop symbol DELETES the file

Details
Type:
Bug
Submit Date:
2008-01-02
Status:
Closed
Updated Date:
2011-02-16
Project Name:
JDK
Resolved Date:
2008-02-19
Component:
deploy
OS:
linux
Sub-Component:
webstart
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
6u10 (b13)

Related Reports
Backport:

Sub Tasks

Description
FULL PRODUCT VERSION :
6.0

A DESCRIPTION OF THE PROBLEM :
I am the author of Pauker (http://pauker.sourceforge.net), a free flashcard programm written in Java. I use Java Web Start for application deployment.
 
I got a bug report from a user who wanted to start Pauker by dragging and dropping a lesson to the Pauker Java Web Start desktop symbol. Unfortunately, this failed and the lesson was DELETED! This kind of bugs are catastrophic.
I could reproduce this problem both on Linux and on Windows. The following exception gets thrown at startup:
 
 InvalidArgumentException[ Ung??ltige Argumente angegeben: {C:\Dokumente und Einstellungen\Nutzer\Desktop\test.pau.gz, C:\DOKUME~1\Nutzer\LOKALE~1\Temp\javaws6 }]
 at com.sun.javaws.Main.launchApp(Unknown Source)
 at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
 at com.sun.javaws.Main$1.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)

There is already a forum discussion here:
http://forum.java.sun.com/thread.jspa?threadID=5245103&tstart=0


REPRODUCIBILITY :
This bug can be reproduced always.

                                    

Comments
EVALUATION

When javaws.exe is invoked with more than one non-parsable arg (ie more than one arg that the native code dosn't sepcifically recognize) the order is reversed, and the first one is moved to be the last one.
This causes the java code to think the second arg is the jnlp file.
The native code also makes a copy of the jnlp file and passes that instead of the original, and passes -Djnlpx.remove=true to java.
Unfortunately, this causes the javaws java code to remove the other file instead of the jnlp file copy.
                                     
2008-01-16
EVALUATION

Problem is actually in two places, _tempfile is set to args[0] which is wrong in Main.java.  This needs to be fixed too for the testcase to work.
                                     
2008-02-08



Hardware and Software, Engineered to Work Together