B4J Question (Linux Arch) B4J + jServer Project Error running

Giu

Member
Licensed User
Longtime User
Hi all.

Seeing there was a script to get B4J working under Linux, just for fun to see if I can come back to B4X, I started to migrate a small project (a gateway) I have in another code to b4x. So far the logic seems to work without errors (compiling errors) but when I added jServer I get errors trying to run.

OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
Waiting for debugger to connect...
Program started.
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
2026-06-07 08:03:38.938:INFO :eek:ejs.Server:main: jetty-11.0.9; built: 2022-03-30T17:44:47.085Z; git: 243a48a658a183130a8c8de353178d154ca04f04; jvm 21.0.11+10-LTS
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
2026-06-07 08:03:39.014:INFO :eek:ejss.DefaultSessionIdManager:main: Session workerName=node0
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
2026-06-07 08:03:39.028:INFO :eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@15eb5ee5{/,file:///Z:/home/devgiu/dev/BUYA~LZW/MIGR~41T/B4J-~CL3/Objects/www,AVAILABLE}
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
2026-06-07 08:03:39.050:INFO :eek:ejs.RequestLogWriter:main: Opened Z:\home\devgiu\dev\b4j-gateway-b4x\migration-preview\b4j-gateway\Objects\logs\b4j-2026_06_07.request.log
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
Error occurred on line: 34 (Main)
java.lang.NullPointerException: Cannot read the array length because "bytes" is null
at java.base/java.lang.String.<init>(String.java:1414)
at java.base/sun.nio.ch.UnixDomainSockets.localAddress(UnixDomainSockets.java:82)
at java.base/sun.nio.ch.SocketChannelImpl.endConnect(SocketChannelImpl.java:824)
at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:894)
at java.base/java.nio.channels.SocketChannel.open(SocketChannel.java:285)
at java.base/sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(PipeImpl.java:132)
at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:85)
at java.base/sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:67)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:571)
at java.base/sun.nio.ch.PipeImpl.<init>(PipeImpl.java:197)
at java.base/sun.nio.ch.WEPollSelectorImpl.<init>(WEPollSelectorImpl.java:79)
at java.base/sun.nio.ch.WEPollSelectorProvider.openSelector(WEPollSelectorProvider.java:33)
at java.base/java.nio.channels.Selector.open(Selector.java:295)
at org.eclipse.jetty.io.SelectorManager.newSelector(SelectorManager.java:254)
at org.eclipse.jetty.io.ManagedSelector.doStart(ManagedSelector.java:112)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:121)
at org.eclipse.jetty.io.SelectorManager.doStart(SelectorManager.java:238)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:171)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:353)
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:75)
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:228)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at org.eclipse.jetty.server.Server.doStart(Server.java:427)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:93)
at anywheresoftware.b4j.object.ServerWrapper.Start(ServerWrapper.java:271)
at b4j.gateway.preview.main._starthttpserver(main.java:138)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:117)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:100)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:104)
at buyapp.gateway.preview.main.main(main.java:29)
b4j-gateway B4J preview listening design for :8080
OpenJDK 64-Bit Server VM warning: Attempt to get process group affinity failed: Llamada no implementada
If I compile and run the jar file with linux java it works.
❯ ./run-b4j.sh
2026-06-07 08:32:27.660:INFO :eek:ejs.Server:main: jetty-11.0.9; built: 2022-03-30T17:44:47.085Z; git: 243a48a658a183130a8c8de353178d154ca04f04; jvm 21.0.11+10
2026-06-07 08:32:27.708:INFO :eek:ejss.DefaultSessionIdManager:main: Session workerName=node0
2026-06-07 08:32:27.716:INFO :eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@2805c96b{/,file:///home/devgiu/dev/b4j-gateway-b4x/migration-preview/b4j-gateway/www,AVAILABLE}
2026-06-07 08:32:27.734:INFO :eek:ejs.RequestLogWriter:main: Opened /home/devgiu/dev/b4j-gateway-b4x/migration-preview/b4j-gateway/logs/b4j-2026_06_07.request.log
2026-06-07 08:32:27.740:INFO :eek:ejs.AbstractConnector:main: Started ServerConnector@735f7ae5{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2026-06-07 08:32:27.747:INFO :eek:ejs.Server:main: Started Server@610694f1{STARTING}[11.0.9,sto=0] @236ms
B4J HTTP server started on port 8080
buyapp-gateway B4J preview listening design for :8080

There are some known workaround to run from b4j and be able to debug from the IDE?
 

hatzisn

Expert
Licensed User
Longtime User
What you can do is create a virtualbox with debian linux, download from bellsoft their full jre and install it in your Debian (.deb file - it includes JavaFX), download b4j-bridge.jar from b4x site, give a static local IP to your linux debian (have it in virtualbox with bridged network - the IP is set inside debian), and you are almost good to go. Next step is install proftpd in debian and upload in a folder tempjars in the same level as b4j-bridge.jar the www and logs folder. Then start b4j-bridge.jar in your debian (java -jar b4j-bridge.jar), connect b4j-bridge (Tools > B4J-Bridge) from your windows machine to the static IP you have set in debian. Start your server by running the code in B4J. The server will run in your debian VM and the logs will be seen in B4J in your windows machine allowing you also to debug. You can also visit the pages served in your server from your windows machine with visiting http://{your static ip in debian}:{serverport}/mypage
 
Last edited:
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
...upload in a folder tempjars in the same level as b4j-bridge.jar the www and logs folder

I am not in front of my computer now and I am not completely sure about this. It might be running in the b4j-bridge.jar folder so the www and logs might need to be uploaded there.
 
Upvote 0

Giu

Member
Licensed User
Longtime User
First of all, thanks for the answer. I don't totaly understand why create a Debian VM. I'm on Arch Linux right now running b4j under wine. Project compiles, just don't runs unless I start from the linux-side java, but then I loose the debug cap. Anyway, It occurred to me to use B4j Bridge, and starts and the /health endpoint works. I just have to do more testing if others still working, env vars config files and so on.......
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
Oh sorry, I thought you were experimenting. As for the ENV you can always create a .sh script that will contain an exclusive set of environment variables specifically set for your jServer implementation. F.e. it can contain the following command:
env TZ=Europe/Athens java -jar myserverapp.jar
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
As long as it has to do with the /health handler (I suppose you will use it for Docker healthcheck) see this that is bugging me from yesterday:

 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Take note that B4J is a Windows application.
Since you are running it using Wine, the whole environment is actually using Windows JDK.
Don't use Linux JDK. Unless you are going to create a Linux package for JavaFX UI app then you need to use Java JDK.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
I don't think the problem is with jServer.
I have debug my inventory system which uses jServer on Linux Mint.
No need to use b4j-bridge.
 
Upvote 0

Giu

Member
Licensed User
Longtime User
I don't think the problem is with jServer.
I have debug my inventory system which uses jServer on Linux Mint.
No need to use b4j-bridge.
No idea,but running the jar with Linux java there are no issues,under wine,I attached to b4j jvm 17,19 y 21with the same result,and seems like some kinds of reported issues with java and wine. Working under b4j Bridge is fine right now, if in the future i solve It,well,better
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Which flavor of Arch Linux are you using? Cachy OS or Manjaro?
 
Upvote 0

teddybear

Well-Known Member
Licensed User
No idea,but running the jar with Linux java there are no issues,under wine,I attached to b4j jvm 17,19 y 21with the same result,and seems like some kinds of reported issues with java and wine. Working under b4j Bridge is fine right now, if in the future i solve It,well,better
Try jvm 11
 
Upvote 0
Top