B4J Question Addo JakartaWsLibrary issue

cbal03

Active Member
Licensed User
Longtime User
It would be great if anyone can help with this. I use this library in a larger project and the problem occurs there as well.

I downloaded the sample b4j project and ran it. It runs fine in debug and release modes but i get a few errors when running it after packaging to a windows exe.
The first error says

websocket_server._startserver (java line: -1)
java.util.ServiceConfigurationError: org.glassfish.tyrus.spi.ServerContainerFactory: module b4j does not declare `uses`
at java.base/java.util.ServiceLoader.fail(Unknown Source)
at java.base/java.util.ServiceLoader.checkCaller(Unknown Source)
at java.base/java.util.ServiceLoader.<init>(Unknown Source)
at java.base/java.util.ServiceLoader.load(Unknown Source)
at b4j/org.glassfish.tyrus.spi.ServerContainerFactory.createServerContainer(Unknown Source)

After adding to #Region Project Attributes :
#PackagerProperty: AdditionalModuleInfoString = uses org.glassfish.tyrus.spi.ServerContainerFactory;

I get a different error below (I guess the previous error was corrected).

websocket_server._startserver (java line: -1)
java.util.ServiceConfigurationError: jakarta.websocket.server.ServerEndpointConfig$Configurator: module b4j does not declare `uses`
at java.base/java.util.ServiceLoader.fail(Unknown Source)
at java.base/java.util.ServiceLoader.checkCaller(Unknown Source)
at java.base/java.util.ServiceLoader.<init>(Unknown Source)
at java.base/java.util.ServiceLoader.load(Unknown Source)
at b4j/jakarta.websocket.server.ServerEndpointConfig$Configurator.fetchContainerDefaultConfigurator(Unknown Source)

Again after adding to #Region Project Attributes :
#PackagerProperty: AdditionalModuleInfoString = uses jakarta.websocket.server.ServerEndpointConfig.Configurator;

I get another error below ( i guess the previous two errors were corrected).
It looks like the server started but it cannot be contacted with the browser test page.

Aug 10, 2025 7:12:56 PM org.glassfish.grizzly.http.server.NetworkListener start
INFO: Started listener bound to [0.0.0.0:3000]
Aug 10, 2025 7:12:56 PM org.glassfish.grizzly.http.server.HttpServer start
INFO: [HttpServer] Started.
java.lang.RuntimeException: Cannot load platform configurator
at b4j/jakarta.websocket.server.ServerEndpointConfig$Configurator.fetchContainerDefaultConfigurator(Unknown Source)
at b4j/jakarta.websocket.server.DefaultServerEndpointConfig.<init>(Unknown Source)
at b4j/jakarta.websocket.server.ServerEndpointConfig$Builder.build(Unknown Source)
at b4j/org.glassfish.tyrus.core.AnnotatedEndpoint.createEndpointConfig(Unknown Source)
at b4j/org.glassfish.tyrus.core.AnnotatedEndpoint.<init>(Unknown Source)

at b4j/org.glassfish.tyrus.core.AnnotatedEndpoint.fromClass(Unknown Source)
at b4j/org.glassfish.tyrus.core.TyrusWebSocketEngine.register(Unknown Source)
at b4j/org.glassfish.tyrus.container.grizzly.server.GrizzlyServerContainer$TyrusGrizzlyServerContainer.register(Unknown Source)
at b4j/org.glassfish.tyrus.server.TyrusServerContainer.start(Unknown Source)
at b4j/org.glassfish.tyrus.container.grizzly.server.GrizzlyServerContainer$TyrusGrizzlyServerContainer.start(Unknown Source)
at b4j/org.glassfish.tyrus.server.Server.start(Unknown Source)
at b4j/addo.jakarta.wserver.JakartaWsLibrary.Start(Unknown Source)
at b4j/b4j.example.websocket_server._startserver(Unknown Source)
at b4j/b4j.example.main._appstart(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
at b4j/anywheresoftware.b4a.BA.raiseEvent(Unknown Source)
at b4j/b4j.example.main.main(Unknown Source)

I don't understand how to deal with this error. I'm not very good with java.
Thanks.
 
Top