JDK-8199304 : javaws.exe failed to launch UTF-8 encoded JNLP file
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 8u161
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2018-02-28
  • Updated: 2019-01-14
  • Resolved: 2018-04-01
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 8
8u172Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_172-ea"
Java(TM) SE Runtime Environment (build 1.8.0_172-ea-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b03, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]


A DESCRIPTION OF THE PROBLEM :
JNLP file having UTF-8 letters failed to launch from command line javaws.exe.


REGRESSION.  Last worked in version 8u151

ADDITIONAL REGRESSION INFORMATION: 
jre1.8.0_144


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Failed:
C:\Program Files\Java\jre1.8.0_172\bin\javaws.exe utf8.jnlp
C:\Program Files\Java\jre1.8.0_161\bin\javaws.exe utf8.jnlp

Succeeded to launch:
C:\Program Files\Java\jre1.8.0_144\bin\javaws.exe utf8.jnlp


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Success to launch the application.
ACTUAL -
"Application Error" dialogue is shown.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
"Application Error" dialogue is shown. stack trace is as follows.


Exception: (the message says that failed to analyze, error in line 0)
-----
JNLParseException[ ������������������������������������������������������0������������������������������������]
	at com.sun.javaws.jnl.XMLFormat.decode(Unknown Source)
	at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
	at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
	at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
	at com.sun.javaws.Main.launchApp(Unknown Source)
	at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
	at com.sun.javaws.Main.access$000(Unknown Source)
	at com.sun.javaws.Main$1.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException: encoding.error.not.xml
	at com.sun.deploy.xml.XMLEncoding.decodeXML(Unknown Source)
	... 9 more



Wrapped Exception:
-----
java.io.EOFException: encoding.error.not.xml
	at com.sun.deploy.xml.XMLEncoding.decodeXML(Unknown Source)
	at com.sun.javaws.jnl.XMLFormat.decode(Unknown Source)
	at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
	at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
	at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
	at com.sun.javaws.Main.launchApp(Unknown Source)
	at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
	at com.sun.javaws.Main.access$000(Unknown Source)
	at com.sun.javaws.Main$1.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Failed:
C:\Program Files\Java\jre1.8.0_172\bin\javaws.exe utf8.jnlp

Reproducing test case, utf8.jnlp is as follows.
The jnlp file contains UTF-8 encoded japanese letters in the <argument> attribute.
<argument>--downloadFiles[0]=DownloadManagerSetup  ........................   .exe</argument>

---------utf8.jnlp begin---------
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.7+"
		codebase="http://127.0.0.1:9000/">
	<information>
		<title>SilverBulletDownloadClient</title>
		<vendor>Skeed Co. Ltd.</vendor>
		<homepage href="http://www.skeed.co.jp" />
		<description kind="one-line">SkeedSilverBullet Client</description>
		<description kind="short">SkeedSilverBullet Client</description>
		<description kind="tooltip">SkeedSilverBullet Client</description>
		<icon kind="default" href="http://127.0.0.1:9000/public/images/ssb_transparent.gif" />
		<icon kind="splash" href="http://127.0.0.1:9000/public/images/ssb_splash.jpg" />
		<offline-allowed/>
	</information>
	<security>
		<all-permissions />
	</security>
	<resources>
		<java version="1.7+" initial-heap-size="8M" max-heap-size="64M"/>
		<jar href="http://127.0.0.1:9000/public/jars/ssb_guic.jar"/>
		<property name="jnlp.packEnabled" value="true" />
	</resources>
	<application-desc main-class="com.skeedtech.skeed_silver_bullet.simple_gui_client.SimpleDownloaderMain">

		<argument>--downloadFiles[0]=DownloadManagerSetup - ��������� - ��������� (2) - ���������.exe</argument>

	</application-desc>
</jnlp>
---------utf8.jnlp end ---------


---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Using ASCII letters by changing application behavior and/or limiting application functionality.
Or using older version of java.



Comments
It looks like we cannot make a proper copy of the jnlp file if the current Windows locale is ���Japanese���. In particular the native method ���SaveBufferToTempFile��� does not work correctly. However copying file in native code is unnecessary and it was removed from JDK 9 via JDK-8135227. Fix: Never copy file in native code.
29-03-2018

The problem was triggered by JDK-8074544
29-03-2018

Most likely this one and JDK-8197466 have the same root cause.
12-03-2018

Reported with: ========== JDK 8u172 ea b03 MS Windows 7 JNLP file having UTF-8 letters fails to launch with JNLParseException when run from command line. Checked this with reported JDK versions in Windows 10 and could confirm the issue as reported. The issue is not reproducible with default English locale. Need to ensure that the Windows display language is "Japanese" in order to verify this issue successfully. Results: ========== 8u144: Ok 8u152: Ok 8u161: Fail 8u162: Fail 8u172 ea b03: Fail To reproduce, switch to Japanese locale (ensure Windows display language is Japanese). Run the jnlp (subsequent comment) with respective Java versions. This seems a regression from JDK 8u161. Output with 8u172 ea b03: ============================== JNLParseException[ ������������������������������������������������������0������������������������������������] at com.sun.javaws.jnl.XMLFormat.decode(Unknown Source) at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source) at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source) at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source) at com.sun.javaws.Main.launchApp(Unknown Source) at com.sun.javaws.Main.continueInSecureThread(Unknown Source) at com.sun.javaws.Main.access$000(Unknown Source) at com.sun.javaws.Main$1.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.io.EOFException: encoding.error.not.xml at com.sun.deploy.xml.XMLEncoding.decodeXML(Unknown Source) =====================================
08-03-2018