Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payara Micro fails to run a MicroProfile example project on Windows #4445

Closed
Karm opened this issue Jan 20, 2020 · 9 comments
Closed

Payara Micro fails to run a MicroProfile example project on Windows #4445

Karm opened this issue Jan 20, 2020 · 9 comments
Assignees

Comments

@Karm
Copy link

Karm commented Jan 20, 2020

MicroProfile example fail on Windows


Expected Outcome

Payara Micro starts and serves landing page

Current Outcome

Jan 20, 2020 1:59:55 AM fish.payara.micro.PayaraMicro main
SEVERE: null
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at fish.payara.micro.boot.loader.MainMethodRunner.run(MainMethodRunner.java:50)
        at fish.payara.micro.boot.loader.Launcher.launch(Launcher.java:114)
        at fish.payara.micro.boot.loader.Launcher.launch(Launcher.java:73)
        at fish.payara.micro.boot.PayaraMicroLauncher.create(PayaraMicroLauncher.java:87)
        at fish.payara.micro.boot.PayaraMicroLauncher.main(PayaraMicroLauncher.java:71)
        at fish.payara.micro.PayaraMicro.main(PayaraMicro.java:397)
Caused by: java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
        at java.base/java.util.Properties.loadConvert(Properties.java:654)
        at java.base/java.util.Properties.load0(Properties.java:454)
        at java.base/java.util.Properties.load(Properties.java:404)
        at fish.payara.micro.impl.PayaraMicroImpl.setBootProperties(PayaraMicroImpl.java:2567)
        at fish.payara.micro.impl.PayaraMicroImpl.create(PayaraMicroImpl.java:205)
        at fish.payara.micro.impl.PayaraMicroImpl.main(PayaraMicroImpl.java:200)
        ... 10 more

Steps to reproduce

C:\tmp
λ powershell -c Invoke-WebRequest -OutFile payara.zip -Uri https://start.microprofile.io/api/project?supportedServer=PAYARA_MICRO

C:\tmp
λ powershell -c Expand-Archive -Path payara.zip -DestinationPath . -Force

C:\tmp
λ cd demo\

C:\tmp\demo
λ mvn clean package

C:\tmp\demo
λ java -jar target/demo-microbundle.jar
Jan 20, 2020 8:05:39 AM fish.payara.micro.PayaraMicro main
SEVERE: null
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at fish.payara.micro.boot.loader.MainMethodRunner.run(MainMethodRunner.java:50)
        at fish.payara.micro.boot.loader.Launcher.launch(Launcher.java:114)
        at fish.payara.micro.boot.loader.Launcher.launch(Launcher.java:73)
        at fish.payara.micro.boot.PayaraMicroLauncher.create(PayaraMicroLauncher.java:87)
        at fish.payara.micro.boot.PayaraMicroLauncher.main(PayaraMicroLauncher.java:71)
        at fish.payara.micro.PayaraMicro.main(PayaraMicro.java:397)
Caused by: java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
        at java.base/java.util.Properties.loadConvert(Properties.java:654)
        at java.base/java.util.Properties.load0(Properties.java:454)
        at java.base/java.util.Properties.load(Properties.java:404)
        at fish.payara.micro.impl.PayaraMicroImpl.setBootProperties(PayaraMicroImpl.java:2567)
        at fish.payara.micro.impl.PayaraMicroImpl.create(PayaraMicroImpl.java:205)
        at fish.payara.micro.impl.PayaraMicroImpl.main(PayaraMicroImpl.java:200)
        ... 10 more

Environment

  • Payara Version: 5.194
  • Edition: Micro
  • JDK Version: OpenJDK 11 HotSpot
  • Operating System: Windows 2019
  • Shell: Both plain cmd and cmder
  • PATH:: C:\tmp\demo λ echo %PATH% C:\Tools\cmder\bin;C:\Tools\cmder\vendor\bin;C:\Tools\cmder\vendor\conemu-maximus5\ConEmu\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Auxiliary\Build;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Strawberry\perl\bin;C:\Strawberry\perl\site\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\RedHat\java-11-openjdk-11.0.1-1\bin;C:\Program Files\7-Zip;C:\Tools\apache-maven-3.6.0\bin;C:\Program Files\dotnet\;C:\Program Files\CMake\bin;C:\Program Files\NASM;C:\Tools\apache-maven-3.6.0\bin;C:\Tools\cmder\bin;C:\Tools\cmder\vendor\bin;C:\Tools\cmder\vendor\conemu-maximus5\ConEmu\Scripts;C:\Tools\cmder\vendor\conemu-maximus5;C:\Tools\cmder\vendor\conemu-maximus5\ConEmu;C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Auxiliary\Build;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Strawberry\perl\bin;C:\Strawberry\perl\site\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\RedHat\java-11-openjdk-11.0.1-1\bin;C:\Program Files\7-Zip;C:\Tools\apache-maven-3.6.0\bin;C:\Program Files\dotnet\;C:\Program Files\CMake\bin;C:\Program Files\NASM;C:\Users\Administrator\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\Administrator\AppData\Local\Programs\Python\Python37\;C:\Users\Administrator\AppData\Lo;C:\Tools\cmder\vendor\git-for-windows\cmd;C:\Tools\cmder\vendor\git-for-windows\mingw64\bin;C:\Tools\cmder\vendor\git-for-windows\usr\bin;C:\Tools\cmder
@Karm Karm changed the title Payara Micro fails to run a MicroProfile example project Payara Micro fails to run a MicroProfile example project on Windows Jan 20, 2020
@rdebusscher
Copy link

Hi @Karm,

The error is due to the fact that you have a \u in your path, namely C:\Tools\cmder\vendor\git-for-windows\usr\bin.

@rdebusscher rdebusscher self-assigned this Jan 20, 2020
@Karm
Copy link
Author

Karm commented Jan 20, 2020

@rdebusscher Thx for the analysis.

@Karm
Copy link
Author

Karm commented Jan 21, 2020

@smillidge How come this is closed? Having a \u string in one's PATH on Windows is common and Payara should be able to handle it. Imagine C:\users\ and more...

@dmatej
Copy link
Contributor

dmatej commented Jan 24, 2020

@smillidge How come this is closed? Having a \u string in one's PATH on Windows is common and Payara should be able to handle it. Imagine C:\users\ and more...

Hi, it is not caused by Payara, but the property file syntax, as it is specified here: https://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.3
You can use native2ascii command to convert property file produced by humans to a Properties file compliant with the specification ... or you can manually replace all backslahes with \u005c which is unicode escape sequence for it.

@dmatej
Copy link
Contributor

dmatej commented Jan 24, 2020

EDIT: bad news, native2ascii and native2ascii-maven-plugin too cannot help. So you have to do that manually ...

@dmatej
Copy link
Contributor

dmatej commented Jan 26, 2020

Final summary - there are two options:

  • use / character instead of \ (I don't have windows, but I expect current windows support this)
  • use \u005c, which is unicode replacement of the '' character.

@Karm
Copy link
Author

Karm commented Feb 4, 2020

THX @dmatej

@pejomstd
Copy link

pejomstd commented Sep 3, 2020

@Karm
Did you solve this?
I am having the same experience.

The advice given is kind of a non advice.
I have multiple programs installed on windows, some referring to folders like ..\usr

I think you should at least verify on Windowsand see if you can solve it or understand why it happens before you close the issue.

I just used https://start.microprofile.io/ to generate project and using maven to compile it, I have no property file at all more than the one in the project. So which property file are you referring to that should be changed to / instead of \.

It cannot really be expected to go into Windows environment variables and change every one of them, something that may not even be possible for people sitting on restricted computers where parts are not accessible.
As it seems to happen in this file: https://github.com/payara/Payara/blob/master/appserver/extras/payara-micro/payara-micro-core/src/main/java/fish/payara/micro/impl/PayaraMicroImpl.java

You could at least verify the problem and/or debug it on Windows.

@Karm
Copy link
Author

Karm commented Sep 3, 2020

@pejomstd I did not solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants