3

I can start Payara v5.192 with JDK11 via command line, but it breaks after trying to start it via IntelliJ with the following error:

-Xbootclasspath/p is no longer a supported option

And I can't even start it via terminal any longer.

This is part of the IntelliJ log:

C:\Program Files\Java\jdk-11.0.3\bin\java.exe
-cp
D:/Program Files/payara-5.192/glassfish/modules/glassfish.jar
-XX:+UnlockDiagnosticVMOptions
-XX:NewRatio=2
-Xbootclasspath/p:D:\Program Files\payara-5.192\glassfish/lib/grizzly-npn-bootstrap-1.8.1.jar
[...]

My project is configured to use JDK 11.0.3, what might the issue be?

EDIT: I'm using IntelliJ 2019.1.3 on Windows, I don't get this issue on Debian

EDIT2: apparently the configuration changes after starting the domain with IntelliJ, here's domain.xml respectively before and after: https://pastebin.com/HAzFgkGn -> https://pastebin.com/F3r3nWet

Alex Sim
  • 403
  • 3
  • 16
  • I believe it might be because the `-Xbootclasspath/p...` option is being specified in the JVM options of Payara (see https://docs.payara.fish/documentation/payara-server/server-configuration/jvm-options.html) and this option was removed starting Java 9. – M A Jun 02 '19 at 11:29
  • @manouti why would it though? Payara supports JDK 11 as of 5.192 – Alex Sim Jun 02 '19 at 11:36
  • @manouti the configuration changes after starting Payara with IntelliJ, check my second edit – Alex Sim Jun 02 '19 at 11:55
  • Might then be an issue with IntelliJ, since you mention Payara starts normally on cmd. It doesn't seem that the domain config changes are related. – M A Jun 02 '19 at 12:26
  • @manouti they actually are, I tried changing back to the former domain.xml and it was starting again with no error on terminal; BTW I said payara started normally on cmd only before trying to open it via IntelliJ, then it did not even start via cmd – Alex Sim Jun 02 '19 at 12:51

1 Answers1

3

I've encountered the same error myself, on macOS High Sierra. The reason for me was a conflict between the JDK version I'm running asadmin by default (1.8), and what IntelliJ put in the domain.xml (11.0.1).

One workaround, besides updating your domain.xml, is to fix the JDK used by asadmin, e.g. by setting the AS_JAVA parameter in glassfish/config/asenv.conf.

EDIT: Since IntelliJ ships with a bundled JDK 1.8, I believe asadmin is run using that instead of the configured JDK 11 causing the conflict -- asadmin appears to check the JDK it was run with and make some (in this case) wrong assumptions.

EDIT 2: JB SDK is not related. The asadmin command is run using the JDK that's in path, instead of the one configured to the domain. You will get this error if your default (in path) JDK is <9, and your JDK configured to your domain is >=9, as the parameters for bootclasspath of npn are parameterized on the running JDK version.

EDIT 3: Reported and confirmed as a bug: https://github.com/payara/Payara/issues/4025

EDIT 4: The fix is merged to the repository, and is on track for the 5.193 release next month.

vlumi
  • 1,321
  • 1
  • 9
  • 18
  • 1
    I'll try using the IntelliJ JBR 11 version then – Alex Sim Jun 06 '19 at 18:38
  • I'll just write this comment in case anyone is having this problem: even if IntelliJ is using JDK 11 by default, you still have to change your JAVA_HOME environment variable to your JDK 11 directory – Alex Sim Jun 19 '19 at 11:15
  • It's a confirmed bug, with hopefully a fix reaching the next release: https://github.com/payara/Payara/issues/4025 As a work-around, the JDK that the launcher is run with should be the same version as configured to the domain. – vlumi Jun 19 '19 at 11:46