Elvis Fabiane
Elvis Fabiane

Reputation: 43

Payara Server does not work with Netbeans 12.6 and JDK 17

We are migrating web apps that use java 1.7 here at the company. We then chose to use the latest stable version of JDK 17 and Payara server (we already use Glassfish), however when linking the server on NetBeans the Java 17 LTS platform does not appear to be selected in the server properties. Has anyone ever experienced this?

Upvotes: 4

Views: 4171

Answers (2)

comul
comul

Reputation: 156

I have the same issue with NB 12.6 and I was expecting NB team to fix this with NB 13. But unfortunately, the issue still exists on 13. Seems related changes in this PR didn't go NB 13 distribution.

After digging for a while found a workaround.

  • Build latest NetBeans from source as described in this link
  • Extract and copy org-netbeans-modules-payara-tooling.jar from built zip into /netbeans/enterprise/modules/ folder in NB 12/13 installation location. (The folder is exact in the built zip)

Of course, the other option is to use NB compiled from source.

Upvotes: 4

skomisa
skomisa

Reputation: 17383

I faced the same problem as you when adding the Payara server: JDK 17 was not offered as a platform for Payara even though NetBeans was running fine on JDK 17. The Java SE Platform window even explicitly gave me the error Payara server could not be started with JDK 17 (Default). Please select another Java SE Platform. when starting Payara.

I don't have a true solution, but a simple workaround is to add JDK 11 as a second Java platform in NetBeans (Tools > Java Platforms > Add Platform...), and then select JDK 11 instead. Payara runs fine under JDK 11:

Select Java platform

After that, just go to http://localhost:4848/ (or whatever alternative port you chose) once the server has been started to verify that Payara is working:

Payara console

Notes :

  1. You can only use LTS releases for Payara, which currently means that your only JDK options are 8, 11 and 17. See Why Payara Platform Only Supports LTS Versions of JDK for more information on that.
  2. I selected the most recent version of Payara that was offered: 5.2021.9.
  3. I don't know why Payara can't be started using JDK 17 even when NetBeans itself is running on JDK 17, but I suspect that it may be relevant that NetBeans 12.6 only offers "experimental support" for JDK 17. You can pursue this by creating a NetBeans Bug Report, though you will have to register first.
  4. FYI, I have pasted below the content of the Payara server log in case you still have problems:

INFO: Create bundle provisioner class = class com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner. Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishRuntime@537969f1 in service registry. #!## LogManagerService.postConstruct : rootFolder=C:\Payara\glassfish #!## LogManagerService.postConstruct : templateDir=C:\Payara\glassfish\lib\templates #!## LogManagerService.postConstruct : src=C:\Payara\glassfish\lib\templates\logging.properties #!## LogManagerService.postConstruct : dest=C:\Payara\glassfish\domains\domain1\config\logging.properties
Running Payara Version: Payara Server 5.2021.9 #badassfish (build 878)|#] Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter|#] Registered fish.payara.ha.hazelcast.store.HazelcastBackingStoreFactoryProxy for persistence-type = hazelcast in BackingStoreFactoryRegistry|#]
Hazelcast Instance Bound to JNDI at payara/Hazelcast|#] JSR107 Caching Provider Bound to JNDI at payara/CachingProvider|#] JSR107 Default Cache Manager Bound to JNDI at payara/CacheManager|#]
Network Listener http-listener-1 started in: 4ms - bound to [/0.0.0.0:8080]|#] HV000001: Hibernate Validator 6.1.5.Final|#]
Network Listener http-listener-2 started in: 1ms - bound to [/0.0.0.0:8181]|#] Network Listener admin-listener started in: 2ms - bound to [/0.0.0.0:4848]|#] Grizzly 2.4.4 started in: 5,262ms - bound to [http-listener-1:8080, http-listener-2:8181, admin-listener:4848]|#] Network Listener iiop-service started in: 2ms - bound to [/0.0.0.0:3700]|#] Payara Server 5.2021.9 #badassfish (878) startup time : Felix (2,025ms), startup services(6,171ms), total(8,196ms)|#] Data Grid Status Payara Data Grid State: DG Version: 4 DG Name: development DG Size: 1 Instances: { DataGrid: development Name: server Lite: false This: true UUID: ffa0f7cb-6228-45bd-a4a0-21e098f4bef9 Address: /192.168.50.15:4900 }|#] Payara Notification Service bootstrapped.|#] Bootstrapping Monitoring Console Runtime|#] Starting monitoring data collection for server|#] Starting monitoring watch collection for server|#]
Network Listener JMS_PROXY_default_JMS_host started in: 2ms - bound to [/0.0.0.0:7676]|#] JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://0.0.0.0:8686/jndi/rmi://0.0.0.0:8686/jmxrmi|#]
GlassFishORBFactory service initialized.|#] Listening to REST requests at context: /management/domain.|#] Skipping registration of inhabitant for service reference [org.osgi.service.metatype.MetaTypeProvider] as the service object could not be obtained.|#] Java security manager is disabled.|#]
Entering Security Startup Service.|#] Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.|#] Security Service(s) started successfully.|#] Created HTTP listener http-listener-1 on host/port 0.0.0.0:8080|#] Created HTTP listener http-listener-2 on host/port 0.0.0.0:8181|#] Created HTTP listener admin-listener on host/port 0.0.0.0:4848|#] Created virtual server server|#] Created virtual server __asadmin|#] Virtual server server loaded default web module |#] Loading application __admingui done in 1,757 ms|#] Initializing Mojarra |version.string| for context ''|#] Loading application [__admingui] at [/]|#] Context path from ServletContext: differs from path from bundle: /|#]
Redirecting to /common/version.jsf|#] Admin Console: Initializing Session Attributes...|#]

INFO: Create bundle provisioner class = class com.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisioner. Registered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishRuntime@537969f1 in service registry. #!## LogManagerService.postConstruct : rootFolder=C:\Payara\glassfish #!## LogManagerService.postConstruct : templateDir=C:\Payara\glassfish\lib\templates #!## LogManagerService.postConstruct : src=C:\Payara\glassfish\lib\templates\logging.properties #!## LogManagerService.postConstruct : dest=C:\Payara\glassfish\domains\domain1\config\logging.properties
Running Payara Version: Payara Server 5.2021.9 #badassfish (build 878)|#] Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter|#] Registered fish.payara.ha.hazelcast.store.HazelcastBackingStoreFactoryProxy for persistence-type = hazelcast in BackingStoreFactoryRegistry|#]
Hazelcast Instance Bound to JNDI at payara/Hazelcast|#] JSR107 Caching Provider Bound to JNDI at payara/CachingProvider|#] JSR107 Default Cache Manager Bound to JNDI at payara/CacheManager|#]
Network Listener http-listener-1 started in: 4ms - bound to [/0.0.0.0:8080]|#] HV000001: Hibernate Validator 6.1.5.Final|#]
Network Listener http-listener-2 started in: 1ms - bound to [/0.0.0.0:8181]|#] Network Listener admin-listener started in: 2ms - bound to [/0.0.0.0:4848]|#] Grizzly 2.4.4 started in: 5,262ms - bound to [http-listener-1:8080, http-listener-2:8181, admin-listener:4848]|#] Network Listener iiop-service started in: 2ms - bound to [/0.0.0.0:3700]|#] Payara Server 5.2021.9 #badassfish (878) startup time : Felix (2,025ms), startup services(6,171ms), total(8,196ms)|#] Data Grid Status Payara Data Grid State: DG Version: 4 DG Name: development DG Size: 1 Instances: { DataGrid: development Name: server Lite: false This: true UUID: ffa0f7cb-6228-45bd-a4a0-21e098f4bef9 Address: /192.168.50.15:4900 }|#] Payara Notification Service bootstrapped.|#] Bootstrapping Monitoring Console Runtime|#] Starting monitoring data collection for server|#] Starting monitoring watch collection for server|#]
Network Listener JMS_PROXY_default_JMS_host started in: 2ms - bound to [/0.0.0.0:7676]|#] JMXStartupService has started JMXConnector on JMXService URL service:jmx:rmi://0.0.0.0:8686/jndi/rmi://0.0.0.0:8686/jmxrmi|#]
GlassFishORBFactory service initialized.|#] Listening to REST requests at context: /management/domain.|#] Skipping registration of inhabitant for service reference [org.osgi.service.metatype.MetaTypeProvider] as the service object could not be obtained.|#] Java security manager is disabled.|#]
Entering Security Startup Service.|#] Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.|#] Security Service(s) started successfully.|#] Created HTTP listener http-listener-1 on host/port 0.0.0.0:8080|#] Created HTTP listener http-listener-2 on host/port 0.0.0.0:8181|#] Created HTTP listener admin-listener on host/port 0.0.0.0:4848|#] Created virtual server server|#] Created virtual server __asadmin|#] Virtual server server loaded default web module |#] Loading application __admingui done in 1,757 ms|#] Initializing Mojarra |version.string| for context ''|#] Loading application [__admingui] at [/]|#] Context path from ServletContext: differs from path from bundle: /|#]
Redirecting to /common/version.jsf|#] Admin Console: Initializing Session Attributes...|#]

Upvotes: 2

Related Questions