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

Jbang ignores bundled MANIFEST.MF options in file of binary jar. #1852

Closed
pedanticdev opened this issue Oct 27, 2024 · 15 comments · Fixed by #1899
Closed

Jbang ignores bundled MANIFEST.MF options in file of binary jar. #1852

pedanticdev opened this issue Oct 27, 2024 · 15 comments · Fixed by #1899
Labels
bug Something isn't working

Comments

@pedanticdev
Copy link

Describe the bug
It appears jbang does not call the jar file using the standard -jar. This results in ignoring any bundled MANIFEST.MF file. In the case of a jar file like Payara Micro, the manifest file contains the needed java modules for it to fully work. ATM jbang introspects the manifest file, and then proceeds to call the Main class of the jar file, passing it any Payara Micro args. This causes the startup to fail because Payara Micro doesn't have all the needed java modules to run properly. The same jar file starts fine with java -jar.

To Reproduce

jbang --verbose fish.payara.extras:payara-micro:6.2024.10                                                               

Expected behavior
Payara Micro starts passing in the required params specified in the manifest (add-opens) file of the jar, reproduced below

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.10.12
Created-By: 11.0.19+7-LTS (Azul Systems, Inc.)
Bundle-SymbolicName: fish.payara.micro
Main-Class: fish.payara.micro.PayaraMicro
Start-Class: fish.payara.micro.impl.PayaraMicroImpl
Add-Exports: java.base/jdk.internal.ref jdk.naming.dns/com.sun.jndi.dn
 s java.naming/com.sun.jndi.ldap
Add-Opens: java.base/jdk.internal.loader java.base/java.lang java.base
 /java.net java.base/java.nio java.base/java.util java.base/sun.nio.ch
  java.management/sun.management jdk.management/com.sun.management.int
 ernal java.base/sun.net.www.protocol.jrt java.base/sun.net.www.protoc
 ol.jar java.base/java.io java.naming/javax.naming.spi java.rmi/sun.rm
 i.transport java.logging/java.util.logging java.management/javax.mana
 gement java.management/javax.management.openmbean

JBang version
Paste output of jbang version --verbose

[jbang] [0:377] jbang version 0.117.1
Cache: /home/seeraj/.jbang/cache
Config: /home/seeraj/.jbang
Repository: /home/seeraj/.m2/repository
Java: /home/seeraj/.sdkman/candidates/java/21.0.3-tem [21.0.3]
OS: linux
Arch: x64
Shell: bash
0.117.1
@pedanticdev pedanticdev added the bug Something isn't working label Oct 27, 2024
@maxandersen
Copy link
Collaborator

Hmmm :/ yeah we don't call via jar because then it's impossible to add dependenicies vis class path reliably.

At least thats my memory :)

Is the jar supposed to be self-contained ?

@pedanticdev
Copy link
Author

Yes. It's supposed to be a runnable, self-contained runtime that can be called to deploy a .war file.

@quintesse
Copy link
Contributor

quintesse commented Oct 28, 2024

@pedanticdev could you pass the error you are getting? I've just tried this with JDK17 and 22 and in both cases things seem to Just Work(tm)?

Edit: ah no, I see there is a warning somewhere in the log about a missing "opens". So it's not that the app fails to start but it just does n't work as it's supposed to.

@quintesse
Copy link
Contributor

Hmmm :/ yeah we don't call via jar because then it's impossible to add dependenicies vis class path reliably.

Indeed, according to the docs:

-jar

Executes a program encapsulated in a JAR file. The first argument is the name of a JAR file instead of a startup class name. For this option to > work, the manifest of the JAR file must contain a line in the form Main-Class: classname. Here, classname identifies the class with the public > static void main(String[] args) method that serves as your application's starting point.

When you use this option, the JAR file is the source of all user classes, and other user class path settings are ignored.

Seems to me that the only recourse we have is to support all the MANIFEST options that -jar supports as well 🙄

@pedanticdev
Copy link
Author

pedanticdev commented Oct 28, 2024

The server starts, but deployment fails as shown below

jbang run --verbose micro --deploy   /home/seeraj/development/repos/personal/ai/jakarta-ai/target/jakarta-ai.war
[jbang] [0:246] jbang version 0.117.1
[jbang] [0:260] Resolving resource ref: micro
[jbang] [0:263] Reading catalog from /home/seeraj/development/repos/personal/jbang-catalog/jbang-catalog.json
[jbang] [0:292] Reading catalog from /home/seeraj/.jbang/implicit-catalog.json
[jbang] [0:294] Reading catalog from classpath:/jbang-catalog.json
[jbang] [0:408] Requesting HTTP GET https://raw.githubusercontent.com/jbanghub/jbang-catalog/main/jbang-catalog.json
[jbang] [0:408] Headers {If-None-Match=["bb8e0fb3960f60906dc21c174f9da593666a1cd324846732dff7476942daf790"], User-Agent=[JBang/0.117.1 (Linux/6.12.0-rc2-2-MANJARO/amd64) Java/21.0.5/Amazon.com Inc.], If-Modified-Since=[Sun, 27 Oct 2024 13:08:59 GMT]}
[jbang] [1:101] Not modified, using cached file /home/seeraj/.jbang/cache/urls/9e5f036f349563e036ce916208ce6a69cea71bd388666b1793f22c8ed96ad73a/jbang-catalog.json for remote https://raw.githubusercontent.com/jbanghub/jbang-catalog/main/jbang-catalog.json
[jbang] [1:110] Reading catalog from https://raw.githubusercontent.com/jbanghub/jbang-catalog/main/jbang-catalog.json
[jbang] [1:112] Obtained catalog from https://raw.githubusercontent.com/jbanghub/jbang-catalog/main/jbang-catalog.json
[jbang] [1:113] Resolving artifact(s): fish.payara.extras:payara-micro:6.2024.10
[jbang] [1:114] Repositories: central=https://repo1.maven.org/maven2/
[jbang] [1:127] Resolved artifact(s) from cache: fish.payara.extras:payara-micro:jar:6.2024.10=/home/seeraj/.m2/repository/fish/payara/extras/payara-micro/6.2024.10/payara-micro-6.2024.10.jar
[jbang] [1:128] Resolved resource ref as: fish.payara.extras:payara-micro:6.2024.10 (cached as: /home/seeraj/.m2/repository/fish/payara/extras/payara-micro/6.2024.10/payara-micro-6.2024.10.jar)
[jbang] [1:152] Resolving artifact(s): fish.payara.extras:payara-micro:6.2024.10
[jbang] [1:152] Repositories: central=https://repo1.maven.org/maven2/
[jbang] [1:152] Resolved artifact(s) from cache: fish.payara.extras:payara-micro:jar:6.2024.10=/home/seeraj/.m2/repository/fish/payara/extras/payara-micro/6.2024.10/payara-micro-6.2024.10.jar
[jbang] [1:153] Looking for JDK: 0
[jbang] [1:155] Using JDK: 21 (21.0.5+11-LTS, current, /home/seeraj/.sdkman/candidates/java/21.0.5-amzn)
[jbang] [1:155] Looking for JDK: 0
[jbang] [1:155] Using JDK: 21 (21.0.5+11-LTS, current, /home/seeraj/.sdkman/candidates/java/21.0.5-amzn)
[jbang] [1:156] run: /home/seeraj/.sdkman/candidates/java/21.0.5-amzn/bin/java -classpath /home/seeraj/.m2/repository/fish/payara/extras/payara-micro/6.2024.10/payara-micro-6.2024.10.jar:/home/seeraj/.m2/repository/fish/payara/extras/payara-micro/6.2024.10/payara-micro-6.2024.10.jar fish.payara.micro.PayaraMicro --deploy /home/seeraj/development/repos/personal/ai/jakarta-ai/target/jakarta-ai.war
[2024-10-28T11:04:56.501+0000] [] [WARNING] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113496501] [levelValue: 900] Payara Micro Runtime directory is located in a temporary file location which can be cleaned by system processes.

[2024-10-28T11:04:56.522+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113496522] [levelValue: 800] Payara Micro Runtime directory is located at /tmp/payaramicro-rt13360242274352916804tmp

[2024-10-28T11:04:56.527+0000] [] [INFO] [] [fish.payara.micro.boot.runtime.PayaraMicroRuntimeBuilder] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113496527] [levelValue: 800] Built Payara Micro Runtime

[2024-10-28T11:04:57.201+0000] [] [INFO] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113497201] [levelValue: 800] [[
  Boot Command set returned with result SUCCESS : PlainTextActionReporterSUCCESSDescription: set AdminCommandnull
    configs.config.server-config.hazelcast-config-specific-configuration.lite=false
]]

[2024-10-28T11:04:57.216+0000] [] [INFO] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113497216] [levelValue: 800] [[
  Boot Command set returned with result SUCCESS : PlainTextActionReporterSUCCESSDescription: set AdminCommandnull
    hazelcast-runtime-configuration.host-aware-partitioning=true
]]

[2024-10-28T11:04:57.223+0000] [] [INFO] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113497223] [levelValue: 800] [[
  Boot Command set returned with result SUCCESS : PlainTextActionReporterSUCCESSDescription: set AdminCommandnull
    hazelcast-runtime-configuration.discovery-mode=multicast
]]

[2024-10-28T11:04:57.582+0000] [] [INFO] [] [org.glassfish.ha.store.spi.BackingStoreFactoryRegistry] [tid: _ThreadID=40 _ThreadName=RunLevelControllerThread-1730113497233] [timeMillis: 1730113497582] [levelValue: 800] Registered fish.payara.ha.hazelcast.store.HazelcastBackingStoreFactoryProxy for persistence-type = hazelcast in BackingStoreFactoryRegistry

[2024-10-28T11:04:57.680+0000] [] [WARNING] [] [com.hazelcast.instance.impl.HazelcastInstanceFactory] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113497229] [timeMillis: 1730113497680] [levelValue: 900] [[
  Hazelcast is starting in a Java modular environment (Java 9 and newer) but without proper access to required Java packages. Use additional Java arguments to provide Hazelcast access to Java internal API. The internal API access is used to get the best performance results. Arguments to be used:
 --add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED]]

[2024-10-28T11:05:00.824+0000] [] [INFO] [] [fish.payara.nucleus.hazelcast.HazelcastCore] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113497229] [timeMillis: 1730113500824] [levelValue: 800] Hazelcast Instance Bound to JNDI at payara/Hazelcast

[2024-10-28T11:05:00.824+0000] [] [INFO] [] [fish.payara.nucleus.hazelcast.HazelcastCore] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113497229] [timeMillis: 1730113500824] [levelValue: 800] JSR107 Caching Provider Bound to JNDI at payara/CachingProvider

[2024-10-28T11:05:00.824+0000] [] [INFO] [] [fish.payara.nucleus.hazelcast.HazelcastCore] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113497229] [timeMillis: 1730113500824] [levelValue: 800] JSR107 Default Cache Manager Bound to JNDI at payara/CacheManager

[2024-10-28T11:05:00.894+0000] [] [INFO] [NCLS-CORE-00101] [javax.enterprise.system.core] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113497229] [timeMillis: 1730113500894] [levelValue: 800] Network Listener http-listener started in: 13ms - bound to [/0.0.0.0:8080]

[2024-10-28T11:05:00.895+0000] [] [INFO] [NCLS-CORE-00058] [javax.enterprise.system.core] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113497229] [timeMillis: 1730113500895] [levelValue: 800] Network listener https-listener on port 8443 disabled per domain.xml

[2024-10-28T11:05:00.896+0000] [] [INFO] [NCLS-CORE-00087] [javax.enterprise.system.core] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113497229] [timeMillis: 1730113500896] [levelValue: 800] Grizzly 4.0.0 started in: 3,419ms - bound to [http-listener:8080]

[2024-10-28T11:05:00.928+0000] [] [INFO] [] [io.opentelemetry.api.GlobalOpenTelemetry] [tid: _ThreadID=37 _ThreadName=RunLevelControllerThread-1730113497226] [timeMillis: 1730113500928] [levelValue: 800] AutoConfiguredOpenTelemetrySdk found on classpath but automatic configuration is disabled. To enable, run your JVM with -Dotel.java.global-autoconfigure.enabled=true

[2024-10-28T11:05:00.952+0000] [] [INFO] [NCLS-CORE-00017] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113500952] [levelValue: 800] Payara Micro 6.2024.10 #badassmicrofish (24) startup time : Embedded (695ms), startup services(3,729ms), total(4,424ms)

[2024-10-28T11:05:00.952+0000] [] [INFO] [] [fish.payara.nucleus.cluster.PayaraCluster] [tid: _ThreadID=96 _ThreadName=Executor-Service-4] [timeMillis: 1730113500952] [levelValue: 800] [[
  Data Grid Status 
Payara Data Grid State: DG Version: 5 DG Name: development DG Size: 1
Instances: {
 DataGrid: development Name: Beautiful-Scorpionfish Lite: false This: true UUID: d1330b77-cc73-4a83-93d3-3cb32a2deb18 Address: /192.168.1.26:6900
}]]

[2024-10-28T11:05:00.954+0000] [] [WARNING] [NCLS-CORE-00069] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113500954] [levelValue: 900] [[
  Exception while dispatching an event
java.lang.reflect.InaccessibleObjectException: Unable to make field private static final java.util.HashMap sun.net.www.protocol.jar.JarFileFactory.fileCache accessible: module java.base does not "opens sun.net.www.protocol.jar" to unnamed module @4ec6a292
        at java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:391)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:367)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:315)
        at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:183)
        at java.base/java.lang.reflect.Field.setAccessible(Field.java:177)
        at com.sun.enterprise.admin.util.JarFileUtils.closeCachedJarFiles(JarFileUtils.java:77)
        at fish.payara.nucleus.util.CleanupPostBoot.event(CleanupPostBoot.java:78)
        at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:135)
        at com.sun.enterprise.v3.server.AppServerStartup.postStartupJob(AppServerStartup.java:434)
        at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:357)
        at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:237)
        at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:219)
        at fish.payara.micro.boot.runtime.MicroGlassFish.start(MicroGlassFish.java:70)
        at fish.payara.micro.impl.PayaraMicroImpl.bootStrap(PayaraMicroImpl.java:1079)
        at fish.payara.micro.impl.PayaraMicroImpl.create(PayaraMicroImpl.java:236)
        at fish.payara.micro.impl.PayaraMicroImpl.main(PayaraMicroImpl.java:223)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        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:88)
        at fish.payara.micro.boot.PayaraMicroLauncher.main(PayaraMicroLauncher.java:72)
        at fish.payara.micro.PayaraMicro.main(PayaraMicro.java:467)
]]

[2024-10-28T11:05:01.008+0000] [] [INFO] [NCLS-JMX-00006] [javax.enterprise.system.jmx] [tid: _ThreadID=103 _ThreadName=Thread-6] [timeMillis: 1730113501008] [levelValue: 800] JMXStartupService has disabled JMXConnector system

[2024-10-28T11:05:01.240+0000] [] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113501240] [levelValue: 800] No deployment transformer implementation found.

[2024-10-28T11:05:01.469+0000] [] [INFO] [NCLS-SECURITY-01002] [javax.enterprise.system.core.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113501469] [levelValue: 800] Java security manager is disabled.

[2024-10-28T11:05:01.469+0000] [] [INFO] [NCLS-SECURITY-01010] [javax.enterprise.system.core.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113501469] [levelValue: 800] Entering Security Startup Service.

[2024-10-28T11:05:01.469+0000] [] [INFO] [NCLS-SECURITY-01143] [javax.enterprise.system.core.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113501469] [levelValue: 800] Loading policy provider fish.payara.security.jacc.provider.PolicyProviderImpl.

[2024-10-28T11:05:01.484+0000] [] [INFO] [NCLS-SECURITY-01011] [javax.enterprise.system.core.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113501484] [levelValue: 800] Security Service(s) started successfully.

[2024-10-28T11:05:01.634+0000] [] [INFO] [AS-WEB-GLUE-00198] [jakarta.enterprise.web] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113501634] [levelValue: 800] Created HTTP listener http-listener on host/port 0.0.0.0:8080

[2024-10-28T11:05:01.651+0000] [] [INFO] [AS-WEB-GLUE-00200] [jakarta.enterprise.web] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113501651] [levelValue: 800] Created virtual server server

[2024-10-28T11:05:01.801+0000] [] [INFO] [AS-WEB-GLUE-00201] [jakarta.enterprise.web] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113501801] [levelValue: 800] Virtual server server loaded default web module 

[2024-10-28T11:05:02.449+0000] [] [INFO] [] [org.jboss.weld.Version] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113502449] [levelValue: 800] WELD-000900: 5.0.1 (Final)

[2024-10-28T11:05:02.489+0000] [] [SEVERE] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113502489] [levelValue: 1000] [[
  Exception while invoking class org.glassfish.weld.WeldDeployer load method
java.lang.reflect.InaccessibleObjectException: Unable to make field private static final java.util.HashMap sun.net.www.protocol.jar.JarFileFactory.fileCache accessible: module java.base does not "opens sun.net.www.protocol.jar" to unnamed module @4ec6a292
        at java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:391)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:367)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:315)
        at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:183)
        at java.base/java.lang.reflect.Field.setAccessible(Field.java:177)
        at com.sun.enterprise.admin.util.JarFileUtils.closeCachedJarFiles(JarFileUtils.java:77)
        at org.glassfish.weld.BeanDeploymentArchiveImpl.parseBeansXML(BeanDeploymentArchiveImpl.java:785)
        at org.glassfish.weld.BeanDeploymentArchiveImpl.populate(BeanDeploymentArchiveImpl.java:403)
        at org.glassfish.weld.BeanDeploymentArchiveImpl.<init>(BeanDeploymentArchiveImpl.java:155)
        at org.glassfish.weld.RootBeanDeploymentArchive.createModuleBda(RootBeanDeploymentArchive.java:97)
        at org.glassfish.weld.RootBeanDeploymentArchive.<init>(RootBeanDeploymentArchive.java:90)
        at org.glassfish.weld.DeploymentImpl.createModuleBda(DeploymentImpl.java:810)
        at org.glassfish.weld.DeploymentImpl.<init>(DeploymentImpl.java:164)
        at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:301)
        at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:152)
        at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:218)
        at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:334)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:580)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:570)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:556)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:552)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at java.base/javax.security.auth.Subject.doAs(Subject.java:453)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:551)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:582)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:574)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at java.base/javax.security.auth.Subject.doAs(Subject.java:453)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:573)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1497)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1879)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1755)
        at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:131)
        at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:104)
        at fish.payara.micro.impl.PayaraMicroImpl.deployAll(PayaraMicroImpl.java:1739)
        at fish.payara.micro.impl.PayaraMicroImpl.bootStrap(PayaraMicroImpl.java:1092)
        at fish.payara.micro.impl.PayaraMicroImpl.create(PayaraMicroImpl.java:236)
        at fish.payara.micro.impl.PayaraMicroImpl.main(PayaraMicroImpl.java:223)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        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:88)
        at fish.payara.micro.boot.PayaraMicroLauncher.main(PayaraMicroLauncher.java:72)
        at fish.payara.micro.PayaraMicro.main(PayaraMicro.java:467)
]]

[2024-10-28T11:05:02.490+0000] [] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113502490] [levelValue: 1000] [[
  Exception during lifecycle processing
java.lang.reflect.InaccessibleObjectException: Unable to make field private static final java.util.HashMap sun.net.www.protocol.jar.JarFileFactory.fileCache accessible: module java.base does not "opens sun.net.www.protocol.jar" to unnamed module @4ec6a292
        at java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:391)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:367)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:315)
        at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:183)
        at java.base/java.lang.reflect.Field.setAccessible(Field.java:177)
        at com.sun.enterprise.admin.util.JarFileUtils.closeCachedJarFiles(JarFileUtils.java:77)
        at org.glassfish.weld.BeanDeploymentArchiveImpl.parseBeansXML(BeanDeploymentArchiveImpl.java:785)
        at org.glassfish.weld.BeanDeploymentArchiveImpl.populate(BeanDeploymentArchiveImpl.java:403)
        at org.glassfish.weld.BeanDeploymentArchiveImpl.<init>(BeanDeploymentArchiveImpl.java:155)
        at org.glassfish.weld.RootBeanDeploymentArchive.createModuleBda(RootBeanDeploymentArchive.java:97)
        at org.glassfish.weld.RootBeanDeploymentArchive.<init>(RootBeanDeploymentArchive.java:90)
        at org.glassfish.weld.DeploymentImpl.createModuleBda(DeploymentImpl.java:810)
        at org.glassfish.weld.DeploymentImpl.<init>(DeploymentImpl.java:164)
        at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:301)
        at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:152)
        at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:218)
        at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:334)
        at com.sun.enterprise.v3.server.ApplicationLifecycle.prepare(ApplicationLifecycle.java:580)
        at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:570)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:556)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:552)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at java.base/javax.security.auth.Subject.doAs(Subject.java:453)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:551)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:582)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:574)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at java.base/javax.security.auth.Subject.doAs(Subject.java:453)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:573)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1497)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1879)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1755)
        at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:131)
        at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:104)
        at fish.payara.micro.impl.PayaraMicroImpl.deployAll(PayaraMicroImpl.java:1739)
        at fish.payara.micro.impl.PayaraMicroImpl.bootStrap(PayaraMicroImpl.java:1092)
        at fish.payara.micro.impl.PayaraMicroImpl.create(PayaraMicroImpl.java:236)
        at fish.payara.micro.impl.PayaraMicroImpl.main(PayaraMicroImpl.java:223)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        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:88)
        at fish.payara.micro.boot.PayaraMicroLauncher.main(PayaraMicroLauncher.java:72)
        at fish.payara.micro.PayaraMicro.main(PayaraMicro.java:467)
]]

[2024-10-28T11:05:02.491+0000] [] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113502491] [levelValue: 1000] Exception while loading the app

[2024-10-28T11:05:02.493+0000] [] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113502493] [levelValue: 1000] Exception while loading the app : Unable to make field private static final java.util.HashMap sun.net.www.protocol.jar.JarFileFactory.fileCache accessible: module java.base does not "opens sun.net.www.protocol.jar" to unnamed module @4ec6a292

[2024-10-28T11:05:02.498+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113502498] [levelValue: 800] Deployed 1 archive(s)

[2024-10-28T11:05:02.509+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113502509] [levelValue: 800] [[
  {
    "Instance Configuration": {
        "Host": "192.168.1.26",
        "Http Port(s)": "8080",
        "Https Port(s)": "",
        "Instance Name": "Beautiful-Scorpionfish",
        "Instance Group": "MicroShoal",
        "Hazelcast Member UUID": "d1330b77-cc73-4a83-93d3-3cb32a2deb18",
        "Deployed": [
        ]
    }
}]]

[2024-10-28T11:05:02.511+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113502511] [levelValue: 800] [[
  
Payara Micro URLs:

]]

[2024-10-28T11:05:02.512+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113502512] [levelValue: 800] Payara Micro 6.2024.10 #badassmicrofish (build 24) ready in 6,061 (ms)

But running the jar directly, I get


java -jar payara-micro-6.2024.10.jar   --deploy /home/seeraj/development/repos/personal/ai/jakarta-ai/target/jakarta-ai.war   INT ✘  35s  
[2024-10-28T11:07:41.722+0000] [] [WARNING] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113661722] [levelValue: 900] Payara Micro Runtime directory is located in a temporary file location which can be cleaned by system processes.

[2024-10-28T11:07:41.747+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113661747] [levelValue: 800] Payara Micro Runtime directory is located at /tmp/payaramicro-rt16674379746386569184tmp

[2024-10-28T11:07:41.753+0000] [] [INFO] [] [fish.payara.micro.boot.runtime.PayaraMicroRuntimeBuilder] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113661753] [levelValue: 800] Built Payara Micro Runtime

[2024-10-28T11:07:42.450+0000] [] [INFO] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113662450] [levelValue: 800] [[
  Boot Command set returned with result SUCCESS : PlainTextActionReporterSUCCESSDescription: set AdminCommandnull
    configs.config.server-config.hazelcast-config-specific-configuration.lite=false
]]

[2024-10-28T11:07:42.467+0000] [] [INFO] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113662467] [levelValue: 800] [[
  Boot Command set returned with result SUCCESS : PlainTextActionReporterSUCCESSDescription: set AdminCommandnull
    hazelcast-runtime-configuration.host-aware-partitioning=true
]]

[2024-10-28T11:07:42.473+0000] [] [INFO] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113662473] [levelValue: 800] [[
  Boot Command set returned with result SUCCESS : PlainTextActionReporterSUCCESSDescription: set AdminCommandnull
    hazelcast-runtime-configuration.discovery-mode=multicast
]]

[2024-10-28T11:07:42.818+0000] [] [INFO] [] [org.glassfish.ha.store.spi.BackingStoreFactoryRegistry] [tid: _ThreadID=37 _ThreadName=RunLevelControllerThread-1730113662476] [timeMillis: 1730113662818] [levelValue: 800] Registered fish.payara.ha.hazelcast.store.HazelcastBackingStoreFactoryProxy for persistence-type = hazelcast in BackingStoreFactoryRegistry

[2024-10-28T11:07:46.494+0000] [] [INFO] [] [fish.payara.nucleus.hazelcast.HazelcastCore] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113662478] [timeMillis: 1730113666494] [levelValue: 800] Hazelcast Instance Bound to JNDI at payara/Hazelcast

[2024-10-28T11:07:46.494+0000] [] [INFO] [] [fish.payara.nucleus.hazelcast.HazelcastCore] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113662478] [timeMillis: 1730113666494] [levelValue: 800] JSR107 Caching Provider Bound to JNDI at payara/CachingProvider

[2024-10-28T11:07:46.495+0000] [] [INFO] [] [fish.payara.nucleus.hazelcast.HazelcastCore] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113662478] [timeMillis: 1730113666495] [levelValue: 800] JSR107 Default Cache Manager Bound to JNDI at payara/CacheManager

[2024-10-28T11:07:46.561+0000] [] [INFO] [NCLS-CORE-00101] [javax.enterprise.system.core] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113662478] [timeMillis: 1730113666561] [levelValue: 800] Network Listener http-listener started in: 6ms - bound to [/0.0.0.0:8080]

[2024-10-28T11:07:46.561+0000] [] [INFO] [NCLS-CORE-00058] [javax.enterprise.system.core] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113662478] [timeMillis: 1730113666561] [levelValue: 800] Network listener https-listener on port 8443 disabled per domain.xml

[2024-10-28T11:07:46.568+0000] [] [INFO] [NCLS-CORE-00087] [javax.enterprise.system.core] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113662478] [timeMillis: 1730113666568] [levelValue: 800] Grizzly 4.0.0 started in: 3,844ms - bound to [http-listener:8080]

[2024-10-28T11:07:46.597+0000] [] [INFO] [] [io.opentelemetry.api.GlobalOpenTelemetry] [tid: _ThreadID=37 _ThreadName=RunLevelControllerThread-1730113662476] [timeMillis: 1730113666597] [levelValue: 800] AutoConfiguredOpenTelemetrySdk found on classpath but automatic configuration is disabled. To enable, run your JVM with -Dotel.java.global-autoconfigure.enabled=true

[2024-10-28T11:07:46.618+0000] [] [INFO] [] [fish.payara.nucleus.cluster.PayaraCluster] [tid: _ThreadID=94 _ThreadName=Executor-Service-2] [timeMillis: 1730113666618] [levelValue: 800] [[
  Data Grid Status 
Payara Data Grid State: DG Version: 5 DG Name: development DG Size: 1
Instances: {
 DataGrid: development Name: Jolly-Pike Lite: false This: true UUID: 168d9610-13d1-4889-b694-8072fbaa6a0c Address: /192.168.1.26:6900
}]]

[2024-10-28T11:07:46.619+0000] [] [INFO] [NCLS-CORE-00017] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113666619] [levelValue: 800] Payara Micro 6.2024.10 #badassmicrofish (24) startup time : Embedded (719ms), startup services(4,146ms), total(4,865ms)

[2024-10-28T11:07:46.670+0000] [] [INFO] [NCLS-JMX-00006] [javax.enterprise.system.jmx] [tid: _ThreadID=104 _ThreadName=Thread-6] [timeMillis: 1730113666670] [levelValue: 800] JMXStartupService has disabled JMXConnector system

[2024-10-28T11:07:46.903+0000] [] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113666903] [levelValue: 800] No deployment transformer implementation found.

[2024-10-28T11:07:47.140+0000] [] [INFO] [NCLS-SECURITY-01002] [javax.enterprise.system.core.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113667140] [levelValue: 800] Java security manager is disabled.

[2024-10-28T11:07:47.141+0000] [] [INFO] [NCLS-SECURITY-01010] [javax.enterprise.system.core.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113667141] [levelValue: 800] Entering Security Startup Service.

[2024-10-28T11:07:47.141+0000] [] [INFO] [NCLS-SECURITY-01143] [javax.enterprise.system.core.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113667141] [levelValue: 800] Loading policy provider fish.payara.security.jacc.provider.PolicyProviderImpl.

[2024-10-28T11:07:47.157+0000] [] [INFO] [NCLS-SECURITY-01011] [javax.enterprise.system.core.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113667157] [levelValue: 800] Security Service(s) started successfully.

[2024-10-28T11:07:47.308+0000] [] [INFO] [AS-WEB-GLUE-00198] [jakarta.enterprise.web] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113667308] [levelValue: 800] Created HTTP listener http-listener on host/port 0.0.0.0:8080

[2024-10-28T11:07:47.323+0000] [] [INFO] [AS-WEB-GLUE-00200] [jakarta.enterprise.web] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113667323] [levelValue: 800] Created virtual server server

[2024-10-28T11:07:47.482+0000] [] [INFO] [AS-WEB-GLUE-00201] [jakarta.enterprise.web] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113667482] [levelValue: 800] Virtual server server loaded default web module 

[2024-10-28T11:07:48.107+0000] [] [INFO] [] [org.jboss.weld.Version] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113668107] [levelValue: 800] WELD-000900: 5.0.1 (Final)

[2024-10-28T11:07:48.714+0000] [] [WARN] [] [fish.payara.nucleus.microprofile.config.spi.ConfigExpressionResolver] [tid: _ThreadID=118 _ThreadName=concurrent/__defaultManagedExecutorService-managedThreadFactory-Thread-2] [timeMillis: 1730113668714] [levelValue: 900] Using null value in configuration, expression ${active.profile}

[2024-10-28T11:07:48.960+0000] [] [INFO] [] [fish.payara.micro.cdi.extension.ClusteredCDIEventBusImpl] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113668960] [levelValue: 800] Clustered CDI Event bus initialized

[2024-10-28T11:07:49.017+0000] [] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113669017] [levelValue: 800] jakarta-ai was successfully deployed in 2,277 milliseconds.

[2024-10-28T11:07:49.018+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113669018] [levelValue: 800] Deployed 1 archive(s)

[2024-10-28T11:07:49.040+0000] [] [INFO] [AS-WEB-GLUE-00130] [jakarta.enterprise.web] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113669040] [levelValue: 800] Invalid Session Management Configuration for non-distributable app [jakarta-ai] - defaulting to memory: persistence-type = [hazelcast] / persistenceFrequency = [web-method] / persistenceScope = [modified-session]

[2024-10-28T11:07:49.062+0000] [] [INFO] [] [org.glassfish.soteria.servlet.SamRegistrationInstaller] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113669062] [levelValue: 800] Initializing Soteria 3.0.3.payara-p1 for context '/jakarta-ai'

[2024-10-28T11:07:49.143+0000] [] [INFO] [AS-WEB-GLUE-00172] [jakarta.enterprise.web] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113669143] [levelValue: 800] Loading application [jakarta-ai] at [/jakarta-ai]

[2024-10-28T11:07:49.153+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113669153] [levelValue: 800] [[
  {
    "Instance Configuration": {
        "Host": "192.168.1.26",
        "Http Port(s)": "8080",
        "Https Port(s)": "",
        "Instance Name": "Jolly-Pike",
        "Instance Group": "MicroShoal",
        "Hazelcast Member UUID": "168d9610-13d1-4889-b694-8072fbaa6a0c",
        "Deployed": [
            {
                "Name": "jakarta-ai",
                "Type": "war",
                "Context Root": "/jakarta-ai"
            }
        ]
    }
}]]

[2024-10-28T11:07:49.156+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113669156] [levelValue: 800] [[
  
Payara Micro URLs:
http://192.168.1.26:8080/jakarta-ai

'jakarta-ai' REST Endpoints:
GET     /jakarta-ai/api/application.wadl
GET     /jakarta-ai/api/hello

]]

[2024-10-28T11:07:49.156+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113669156] [levelValue: 800] Payara Micro 6.2024.10 #badassmicrofish (build 24) ready in 7,476 (ms)

java -jar payara-micro-6.2024.10.jar   --deploy /home/seeraj/development/repos/personal/ai/jakarta-ai/target/jakarta-ai.war   INT ✘  35s  
[2024-10-28T11:07:41.722+0000] [] [WARNING] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113661722] [levelValue: 900] Payara Micro Runtime directory is located in a temporary file location which can be cleaned by system processes.

[2024-10-28T11:07:41.747+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113661747] [levelValue: 800] Payara Micro Runtime directory is located at /tmp/payaramicro-rt16674379746386569184tmp

[2024-10-28T11:07:41.753+0000] [] [INFO] [] [fish.payara.micro.boot.runtime.PayaraMicroRuntimeBuilder] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113661753] [levelValue: 800] Built Payara Micro Runtime

[2024-10-28T11:07:42.450+0000] [] [INFO] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113662450] [levelValue: 800] [[
  Boot Command set returned with result SUCCESS : PlainTextActionReporterSUCCESSDescription: set AdminCommandnull
    configs.config.server-config.hazelcast-config-specific-configuration.lite=false
]]

[2024-10-28T11:07:42.467+0000] [] [INFO] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113662467] [levelValue: 800] [[
  Boot Command set returned with result SUCCESS : PlainTextActionReporterSUCCESSDescription: set AdminCommandnull
    hazelcast-runtime-configuration.host-aware-partitioning=true
]]

[2024-10-28T11:07:42.473+0000] [] [INFO] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730113662473] [levelValue: 800] [[
  Boot Command set returned with result SUCCESS : PlainTextActionReporterSUCCESSDescription: set AdminCommandnull
    hazelcast-runtime-configuration.discovery-mode=multicast
]]

[2024-10-28T11:07:42.818+0000] [] [INFO] [] [org.glassfish.ha.store.spi.BackingStoreFactoryRegistry] [tid: _ThreadID=37 _ThreadName=RunLevelControllerThread-1730113662476] [timeMillis: 1730113662818] [levelValue: 800] Registered fish.payara.ha.hazelcast.store.HazelcastBackingStoreFactoryProxy for persistence-type = hazelcast in BackingStoreFactoryRegistry

[2024-10-28T11:07:46.494+0000] [] [INFO] [] [fish.payara.nucleus.hazelcast.HazelcastCore] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113662478] [timeMillis: 1730113666494] [levelValue: 800] Hazelcast Instance Bound to JNDI at payara/Hazelcast

[2024-10-28T11:07:46.494+0000] [] [INFO] [] [fish.payara.nucleus.hazelcast.HazelcastCore] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113662478] [timeMillis: 1730113666494] [levelValue: 800] JSR107 Caching Provider Bound to JNDI at payara/CachingProvider

[2024-10-28T11:07:46.495+0000] [] [INFO] [] [fish.payara.nucleus.hazelcast.HazelcastCore] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113662478] [timeMillis: 1730113666495] [levelValue: 800] JSR107 Default Cache Manager Bound to JNDI at payara/CacheManager

[2024-10-28T11:07:46.561+0000] [] [INFO] [NCLS-CORE-00101] [javax.enterprise.system.core] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730113662478] [timeMillis: 1730113666561] [levelValue: 800] Network Listener http-listener started in: 6ms - bound to [/0.0.0.0:8080]

If there is a way to pass the add-opens, I believe that should should be a workaround? Pardon me if I'm missing something obvious.

@maxandersen
Copy link
Collaborator

maxandersen commented Oct 28, 2024

@pedanticdev yes, there is -R option (alias for --java-options or --runtime-options) so you can workaround that way but that also then reveals the big weakness in current java tooling...that users have to do a lot to run even the most basic thing....

Probably in the case of running a jar archive with a manifest.mf in it already should at least consider copying or somehow obeying what is listed in the manifest...because yeah, the issue is that java -jar ... does not allow external class or module path so adding dependencies are impossible.

@maxandersen
Copy link
Collaborator

I tried:

jbang -R--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED -R--add-exports=jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED -R--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED -R--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED -R--add-opens=java.base/java.lang=ALL-UNNAMED -R--add-opens=java.base/java.net=ALL-UNNAMED -R--add-opens=java.base/java.nio=ALL-UNNAMED -R--add-opens=java.base/java.util=ALL-UNNAMED -R--add-opens=java.base/sun.nio.ch=ALL-UNNAMED -R--add-opens=java.management/sun.management=ALL-UNNAMED -R--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED -R--add-opens=java.base/sun.net.www.protocol.jrt=ALL-UNNAMED -R--add-opens=java.base/sun.net.www.protocol.jar=ALL-UNNAMED -R--add-opens=java.base/java.io=ALL-UNNAMED -R--add-opens=java.naming/javax.naming.spi=ALL-UNNAMED -R--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -R--add-opens=java.logging/java.util.logging=ALL-UNNAMED -R--add-opens=java.management/javax.management=ALL-UNNAMED -R--add-opens=java.management/javax.management.openmbean=ALL-UNNAMED --java 21 fish.payara.extras:payara-micro:6.2024.10

basically add all opens by hand, but now fails with a bunch of runtime exceptions in hazelcast and others (too long to paste :)

so its probably more than just all opens.

@pedanticdev
Copy link
Author

Works fine here. But looks very ... intimidating.

jbang -R --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED \                                                             
-R--add-exports=jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED \
-R--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED \
-R--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED \
-R--add-opens=java.base/java.lang=ALL-UNNAMED \
-R--add-opens=java.base/java.net=ALL-UNNAMED \
-R--add-opens=java.base/java.nio=ALL-UNNAMED \
-R--add-opens=java.base/java.util=ALL-UNNAMED \
-R--add-opens=java.base/sun.nio.ch=ALL-UNNAMED \
-R--add-opens=java.management/sun.management=ALL-UNNAMED \
-R--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED \
-R--add-opens=java.base/sun.net.www.protocol.jrt=ALL-UNNAMED \
-R--add-opens=java.base/sun.net.www.protocol.jar=ALL-UNNAMED \
-R--add-opens=java.base/java.io=ALL-UNNAMED \
-R--add-opens=java.naming/javax.naming.spi=ALL-UNNAMED \
-R--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED \
-R--add-opens=java.logging/java.util.logging=ALL-UNNAMED \
-R--add-opens=java.management/javax.management=ALL-UNNAMED \
-R--add-opens=java.management/javax.management.openmbean=ALL-UNNAMED \
--java 21 \
fish.payara.extras:payara-micro:6.2024.10 --deploy /home/seeraj/development/repos/personal/ai/jakarta-ai/target/jakarta-ai.war
[2024-10-28T13:03:28.802+0000] [] [WARNING] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120608802] [levelValue: 900] Payara Micro Runtime directory is located in a temporary file location which can be cleaned by system processes.

[2024-10-28T13:03:28.823+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120608823] [levelValue: 800] Payara Micro Runtime directory is located at /tmp/payaramicro-rt12929117381488234973tmp

[2024-10-28T13:03:28.829+0000] [] [INFO] [] [fish.payara.micro.boot.runtime.PayaraMicroRuntimeBuilder] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120608829] [levelValue: 800] Built Payara Micro Runtime

[2024-10-28T13:03:29.478+0000] [] [INFO] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120609478] [levelValue: 800] [[
  Boot Command set returned with result SUCCESS : PlainTextActionReporterSUCCESSDescription: set AdminCommandnull
    configs.config.server-config.hazelcast-config-specific-configuration.lite=false
]]

[2024-10-28T13:03:29.494+0000] [] [INFO] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120609494] [levelValue: 800] [[
  Boot Command set returned with result SUCCESS : PlainTextActionReporterSUCCESSDescription: set AdminCommandnull
    hazelcast-runtime-configuration.host-aware-partitioning=true
]]

[2024-10-28T13:03:29.499+0000] [] [INFO] [] [fish.payara.boot.runtime.BootCommand] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120609499] [levelValue: 800] [[
  Boot Command set returned with result SUCCESS : PlainTextActionReporterSUCCESSDescription: set AdminCommandnull
    hazelcast-runtime-configuration.discovery-mode=multicast
]]

[2024-10-28T13:03:29.846+0000] [] [INFO] [] [org.glassfish.ha.store.spi.BackingStoreFactoryRegistry] [tid: _ThreadID=37 _ThreadName=RunLevelControllerThread-1730120609502] [timeMillis: 1730120609846] [levelValue: 800] Registered fish.payara.ha.hazelcast.store.HazelcastBackingStoreFactoryProxy for persistence-type = hazelcast in BackingStoreFactoryRegistry

[2024-10-28T13:03:33.054+0000] [] [INFO] [] [fish.payara.nucleus.hazelcast.HazelcastCore] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730120609503] [timeMillis: 1730120613054] [levelValue: 800] Hazelcast Instance Bound to JNDI at payara/Hazelcast

[2024-10-28T13:03:33.054+0000] [] [INFO] [] [fish.payara.nucleus.hazelcast.HazelcastCore] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730120609503] [timeMillis: 1730120613054] [levelValue: 800] JSR107 Caching Provider Bound to JNDI at payara/CachingProvider

[2024-10-28T13:03:33.054+0000] [] [INFO] [] [fish.payara.nucleus.hazelcast.HazelcastCore] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730120609503] [timeMillis: 1730120613054] [levelValue: 800] JSR107 Default Cache Manager Bound to JNDI at payara/CacheManager

[2024-10-28T13:03:33.125+0000] [] [INFO] [NCLS-CORE-00101] [javax.enterprise.system.core] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730120609503] [timeMillis: 1730120613125] [levelValue: 800] Network Listener http-listener started in: 5ms - bound to [/0.0.0.0:8080]

[2024-10-28T13:03:33.125+0000] [] [INFO] [NCLS-CORE-00058] [javax.enterprise.system.core] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730120609503] [timeMillis: 1730120613125] [levelValue: 800] Network listener https-listener on port 8443 disabled per domain.xml

[2024-10-28T13:03:33.126+0000] [] [INFO] [NCLS-CORE-00087] [javax.enterprise.system.core] [tid: _ThreadID=38 _ThreadName=RunLevelControllerThread-1730120609503] [timeMillis: 1730120613126] [levelValue: 800] Grizzly 4.0.0 started in: 3,386ms - bound to [http-listener:8080]

[2024-10-28T13:03:33.159+0000] [] [INFO] [] [io.opentelemetry.api.GlobalOpenTelemetry] [tid: _ThreadID=39 _ThreadName=RunLevelControllerThread-1730120609507] [timeMillis: 1730120613159] [levelValue: 800] AutoConfiguredOpenTelemetrySdk found on classpath but automatic configuration is disabled. To enable, run your JVM with -Dotel.java.global-autoconfigure.enabled=true

[2024-10-28T13:03:33.187+0000] [] [INFO] [] [fish.payara.nucleus.cluster.PayaraCluster] [tid: _ThreadID=92 _ThreadName=Executor-Service-1] [timeMillis: 1730120613187] [levelValue: 800] [[
  Data Grid Status 
Payara Data Grid State: DG Version: 5 DG Name: development DG Size: 1
Instances: {
 DataGrid: development Name: Tough-Tetra Lite: false This: true UUID: df84a7df-116d-4310-9db8-3096ca24490c Address: /192.168.1.26:6900
}]]

[2024-10-28T13:03:33.188+0000] [] [INFO] [NCLS-CORE-00017] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120613188] [levelValue: 800] Payara Micro 6.2024.10 #badassmicrofish (24) startup time : Embedded (669ms), startup services(3,689ms), total(4,358ms)

[2024-10-28T13:03:33.244+0000] [] [INFO] [NCLS-JMX-00006] [javax.enterprise.system.jmx] [tid: _ThreadID=102 _ThreadName=Thread-6] [timeMillis: 1730120613244] [levelValue: 800] JMXStartupService has disabled JMXConnector system

[2024-10-28T13:03:33.540+0000] [] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120613540] [levelValue: 800] No deployment transformer implementation found.

[2024-10-28T13:03:33.764+0000] [] [INFO] [NCLS-SECURITY-01002] [javax.enterprise.system.core.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120613764] [levelValue: 800] Java security manager is disabled.

[2024-10-28T13:03:33.765+0000] [] [INFO] [NCLS-SECURITY-01010] [javax.enterprise.system.core.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120613765] [levelValue: 800] Entering Security Startup Service.

[2024-10-28T13:03:33.765+0000] [] [INFO] [NCLS-SECURITY-01143] [javax.enterprise.system.core.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120613765] [levelValue: 800] Loading policy provider fish.payara.security.jacc.provider.PolicyProviderImpl.

[2024-10-28T13:03:33.783+0000] [] [INFO] [NCLS-SECURITY-01011] [javax.enterprise.system.core.security] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120613783] [levelValue: 800] Security Service(s) started successfully.

[2024-10-28T13:03:33.928+0000] [] [INFO] [AS-WEB-GLUE-00198] [jakarta.enterprise.web] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120613928] [levelValue: 800] Created HTTP listener http-listener on host/port 0.0.0.0:8080

[2024-10-28T13:03:33.944+0000] [] [INFO] [AS-WEB-GLUE-00200] [jakarta.enterprise.web] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120613944] [levelValue: 800] Created virtual server server

[2024-10-28T13:03:34.091+0000] [] [INFO] [AS-WEB-GLUE-00201] [jakarta.enterprise.web] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120614091] [levelValue: 800] Virtual server server loaded default web module 

[2024-10-28T13:03:34.697+0000] [] [INFO] [] [org.jboss.weld.Version] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120614697] [levelValue: 800] WELD-000900: 5.0.1 (Final)

[2024-10-28T13:03:35.222+0000] [] [WARN] [] [fish.payara.nucleus.microprofile.config.spi.ConfigExpressionResolver] [tid: _ThreadID=123 _ThreadName=concurrent/__defaultManagedExecutorService-managedThreadFactory-Thread-8] [timeMillis: 1730120615222] [levelValue: 900] Using null value in configuration, expression ${active.profile}

[2024-10-28T13:03:35.428+0000] [] [INFO] [] [fish.payara.micro.cdi.extension.ClusteredCDIEventBusImpl] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120615428] [levelValue: 800] Clustered CDI Event bus initialized

[2024-10-28T13:03:35.480+0000] [] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120615480] [levelValue: 800] jakarta-ai was successfully deployed in 2,162 milliseconds.

[2024-10-28T13:03:35.482+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120615482] [levelValue: 800] Deployed 1 archive(s)

[2024-10-28T13:03:35.504+0000] [] [INFO] [AS-WEB-GLUE-00130] [jakarta.enterprise.web] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120615504] [levelValue: 800] Invalid Session Management Configuration for non-distributable app [jakarta-ai] - defaulting to memory: persistence-type = [hazelcast] / persistenceFrequency = [web-method] / persistenceScope = [modified-session]

[2024-10-28T13:03:35.524+0000] [] [INFO] [] [org.glassfish.soteria.servlet.SamRegistrationInstaller] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120615524] [levelValue: 800] Initializing Soteria 3.0.3.payara-p1 for context '/jakarta-ai'

[2024-10-28T13:03:35.607+0000] [] [INFO] [AS-WEB-GLUE-00172] [jakarta.enterprise.web] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120615607] [levelValue: 800] Loading application [jakarta-ai] at [/jakarta-ai]

[2024-10-28T13:03:35.618+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120615618] [levelValue: 800] [[
  {
    "Instance Configuration": {
        "Host": "192.168.1.26",
        "Http Port(s)": "8080",
        "Https Port(s)": "",
        "Instance Name": "Tough-Tetra",
        "Instance Group": "MicroShoal",
        "Hazelcast Member UUID": "df84a7df-116d-4310-9db8-3096ca24490c",
        "Deployed": [
            {
                "Name": "jakarta-ai",
                "Type": "war",
                "Context Root": "/jakarta-ai"
            }
        ]
    }
}]]

[2024-10-28T13:03:35.622+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120615622] [levelValue: 800] [[
  
Payara Micro URLs:
http://192.168.1.26:8080/jakarta-ai

'jakarta-ai' REST Endpoints:
GET     /jakarta-ai/api/application.wadl
GET     /jakarta-ai/api/hello

]]

[2024-10-28T13:03:35.622+0000] [] [INFO] [] [PayaraMicro] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1730120615622] [levelValue: 800] Payara Micro 6.2024.10 #badassmicrofish (build 24) ready in 6,860 (ms)

Is there a way to add the -R options to the json catalog file?

{
  "catalogs": {},
  "aliases": {

    "micro": {
      "script-ref": "fish.payara.extras:payara-micro:6.2024.10",
      "description": "Payara Micro is an embedded release of Payara built from the Payara Embedded Web release. It allows you to deploy and run WAR files from the command line with a single command, and also features automatic, dynamic clustering with Hazelcast."
    }
  },
  "templates": {}
}

@quintesse
Copy link
Contributor

Is there a way to add the -R options to the json catalog file?

Yes, there is a runtime-options element that you can specify in the catalog file.
IIRC you can simply add the -R option when creating an alias (using jbang alias add -R xxx ...) and it will add that option automatically.

@pedanticdev
Copy link
Author

Ok this works


"micro": {
      "runtime-options": [
        "--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED",
        "--add-exports=jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED",
        "--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED",
        "--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED",
        "--add-opens=java.base/java.lang=ALL-UNNAMED",
        "--add-opens=java.base/java.net=ALL-UNNAMED",
        "--add-opens=java.base/java.nio=ALL-UNNAMED",
        "--add-opens=java.base/java.util=ALL-UNNAMED",
        "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED",
        "--add-opens=java.management/sun.management=ALL-UNNAMED",
        "--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED",
        "--add-opens=java.base/sun.net.www.protocol.jrt=ALL-UNNAMED",
        "--add-opens=java.base/sun.net.www.protocol.jar=ALL-UNNAMED",
        "--add-opens=java.base/java.io=ALL-UNNAMED",
        "--add-opens=java.naming/javax.naming.spi=ALL-UNNAMED",
        "--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED",
        "--add-opens=java.logging/java.util.logging=ALL-UNNAMED",
        "--add-opens=java.management/javax.management=ALL-UNNAMED",
        "--add-opens=java.management/javax.management.openmbean=ALL-UNNAMED"
      ],
      "script-ref": "fish.payara.extras:payara-micro:6.2024.10",
      "description": "Payara Micro is an embedded release of Payara built from the Payara Embedded Web release. It allows you to deploy and run WAR files from the command line with a single command, and also features automatic, dynamic clustering with Hazelcast."
    }

Thanks a lot everyone. Still getting the hang of JBang.

@quintesse
Copy link
Contributor

No, thank you for pointing out an issue we were not aware of! :-)

@maxandersen
Copy link
Collaborator

So I'm not actually sure what is the "right" solution here.

If calling a jar with zero dependecies we could just run the jar directly.

But then can't add additional jars.

So then we could consider adding a "-jar" option that honors jar run semantics.

But question is then if we copy all the manifests flags when running normally we can't actually just copy to a manifest but rather have it be converted to explicit command line options...

But not sure that will actually be equivalent behaviour.

@quintesse
Copy link
Contributor

Well, couldn't we simply honor the Add-Exports and Add-Opens manifest options? We honor Main-Class without using a -jar option, so why not those? (Assuming that it's not possible to create values that actually cause problems)

@maxandersen
Copy link
Collaborator

Yes - could work. but I'm not sure about the module name. Does it matter? Or should we just treat the top level as unnamed module ?

@quintesse
Copy link
Contributor

Well, I was hoping we could just take the names from those values and add =ALL-UNNAMED to all of them 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants