JDK-8137114 : native launcher not finding cfg-file
  • Type: Bug
  • Component: deploy
  • Sub-Component: packager
  • Affected Version: 8u60,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2015-09-24
  • Updated: 2017-12-09
  • Resolved: 2017-12-09
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 10
10Fixed
Description
FULL PRODUCT VERSION :
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Linux jfx-dev 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
I'm the main contributor to the javafx-maven-plugin, and while debugging an issue which got reported, I discovered a bug within the native launcher of the linux-version.

After searching through the source of the packaged libpackager.so, the discovery of the ".cfg"-file is wrong on linux-systems.

When the application has a name with a DOT inside its name, e.g. "i-am.not.working", which is pretty okay for linux executables, the launcher searches for a filename "i-am.not.cfg", but the packager generates the filename "i-am.not.working.cfg".

The only feedback of the launcher is, that no main class could be found, but that is misleading.

To see the conclusion of my findings, please have a look at the issue, which can be found here:
https://github.com/javafx-maven-plugin/javafx-maven-plugin/issues/124

REGRESSION.  Last worked in version 8u40

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
* create a javafx-application with a dot inside it's application-name.
* try to run that application via native launcher

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Running the launcher, which uses the right cfg-file.
ACTUAL -
Launcher is not finding generated cfg-file, just saying something about main class not being found.

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Renaming the generated cfg-file by removing the "second extension":

assumed application-name: i-am.not.working

not working:
"i-am.not.working.cfg"

working:
"i-am.not.cfg"


Comments
http://hg.openjdk.java.net/openjfx/jfx-dev/rt/rev/ffc525c332e2
09-12-2017

+1
08-12-2017

webrev: http://cr.openjdk.java.net/~vdrozdov/JDK-8137114/webrev.00/
08-12-2017

Additional details from submitter: ============================ Coming from the not-so-changed sourcecode for the library packager.dll/libpackager.so I identified the following problem: https://github.com/teamfx/openjfx-9-dev-rt/blob/master/modules/jdk.packager/src/main/native/library/common/GenericPlatform.cpp The method "TString GenericPlatform::GetAppName()" shows the problem I described: On windows AND linux systems, the "extension"-part is removed, which results in some working application name on windows (as the executable has the extension ".exe"), but on linux systems you do not have such extensions for executables. As far as I can see, there is an additional C-macro switch required: #if defined(WINDOWS) || defined(LINUX) TString GenericPlatform::GetAppName() { TString result = GetModuleFileName(); result = FilePath::ExtractFileName(result); #if defined(WINDOWS) result = FilePath::ChangeFileExt(result, _T("")); #endif //WINDOWS return result; } #endif //WINDOWS || LINUX Did you test this on a Windows-machine or Linux-machine? On Windows-systems it works like expected, but not on linux-systems when having some application name with multiple DOTS inside (e.g. having some version-string in it). ================================
05-07-2017

Linux and Windows share this function but they should have their own implementations. #if defined(WINDOWS) || defined(LINUX) TString GenericPlatform::GetAppName() { TString result = GetModuleFileName(); result = FilePath::ExtractFileName(result); result = FilePath::ChangeFileExt(result, _T("")); return result; } #endif //WINDOWS || LINUX
05-06-2017

Assigned per email discussion.
05-06-2017

On Ubuntu 16.04 LTS, created and ran the test with JDK 8u131 and couldn't reproduce as stated. To reproduce, create a javafx-application i-am.not.working and then run application via native launcher Both launcher and packager has reference to correct cfg file - i-am.not.working To verify run and check the attached application (i-am.not.working.zip). This still need to be checked for 9 ea though. Meanwhile, writing back to the submitter to reconfirm the status at his end.
18-05-2017

Pardeep to check on latest 8u and 9
17-05-2017