B4J Question B4JPackager11 Error

walterf25

Expert
Licensed User
Hi All, I am trying to create a stand-alone exe file for a project i just finished, i came across the B4JPackager11 and i am able to run it but i get the following errors, i was wondering if someone could help me figure out how to fix this, I know the errors probably mean that the packager can not find some files or classes, but how do i fix this, sorry but this is the first time i use the B4JPackager.

module-info.java:28: error: cannot find symbol
uses javax.websocket.server.ServerEndpointConfig$Configurator;
^
symbol: class ServerEndpointConfig$Configurator
location: package javax.websocket.server
module-info.java:30: error: cannot find symbol
uses org.eclipse.jetty.io.ssl.ALPNProcessor$Server;
^
symbol: class ALPNProcessor$Server
location: package org.eclipse.jetty.io.ssl
2 errors
Thanks,
 

walterf25

Expert
Licensed User
It doesn't look like a UI app. B4JPackager(11) expects UI applications, though it might be possible to use it with non-ui apps as well.

Which libraries are referenced?
It is a UI App, i am referencing all the libs in the image attached.

libs.PNG


Thanks,
Walter
 

walterf25

Expert
Licensed User
What are you using jServer for?

Comment lines 198 to 202:
B4X:
    If File.Exists(TempFolder, ReplaceSlashes("META-INF\services")) Then
       For Each f As String In File.ListFiles(File.Combine(TempFolder, ReplaceSlashes("META-INF\services")))
           sb.Append("uses ").Append(f).Append(";").Append(CRLF)
       Next
   End If
I am using the jServer library just to get the PC's IP Address, I tried commenting out that part of the code and taking the library out but I still got the same errors posted on the first post.

I will try commenting out the lines 198 to 202 as you are suggesting and let you know tomorrow how it goes.

Thanks,
Walter
 

walterf25

Expert
Licensed User
Remove the library. Add jNetwork and get the ip address with ServerSocket. No need to initialize ServerSocket for this.
I did as you suggested, i was able to build the .exe file, but when I execute the run.exe file i get the following errors when running the run_debug.bat file.

java.util.ServiceConfigurationError: org.eclipse.jetty.http.HttpFieldPreEncoder: 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.eclipse.jetty.http.PreEncodedHttpField.<clinit>(Unknown Source)
at b4j/org.eclipse.jetty.http.MimeTypes$Type.<init>(Unknown Source)
at b4j/org.eclipse.jetty.http.MimeTypes$Type.<clinit>(Unknown Source)
at b4j/org.eclipse.jetty.http.MimeTypes.<clinit>(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.ContextHandler.doStart(Unknown Source)
at b4j/org.eclipse.jetty.servlet.ServletContextHandler.doStart(Unknown Source)
at b4j/org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source)
at b4j/org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source)
at b4j/org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.AbstractHandler.doStart(Unknown Source)
at b4j/org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source)
at b4j/org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source)
at b4j/org.eclipse.jetty.server.Server.start(Unknown Source)
at b4j/org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.AbstractHandler.doStart(Unknown Source)
at b4j/org.eclipse.jetty.server.Server.doStart(Unknown Source)
at b4j/org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source)
at b4j/anywheresoftware.b4j.object.ServerWrapper.Start(Unknown Source)
at b4j/com.genesis.rfidinventory.main._btnstartserver_click(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$1.run(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

java.lang.RuntimeException: java.util.ServiceConfigurationError: org.eclipse.jetty.http.HttpFieldPreEncoder: module b4j does not declare `uses`
at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
at b4j/anywheresoftware.b4a.BA$1.run(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.util.ServiceConfigurationError: org.eclipse.jetty.http.HttpFieldPreEncoder: 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.eclipse.jetty.http.PreEncodedHttpField.<clinit>(Unknown Source)
at b4j/org.eclipse.jetty.http.MimeTypes$Type.<init>(Unknown Source)
at b4j/org.eclipse.jetty.http.MimeTypes$Type.<clinit>(Unknown Source)
at b4j/org.eclipse.jetty.http.MimeTypes.<clinit>(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.ContextHandler.doStart(Unknown Source)
at b4j/org.eclipse.jetty.servlet.ServletContextHandler.doStart(Unknown Source)
at b4j/org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source)
at b4j/org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source)
at b4j/org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.AbstractHandler.doStart(Unknown Source)
at b4j/org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source)
at b4j/org.eclipse.jetty.util.component.ContainerLifeCycle.start(Unknown Source)
at b4j/org.eclipse.jetty.server.Server.start(Unknown Source)
at b4j/org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.AbstractHandler.doStart(Unknown Source)
at b4j/org.eclipse.jetty.server.Server.doStart(Unknown Source)
at b4j/org.eclipse.jetty.util.component.AbstractLifeCycle.start(Unknown Source)
at b4j/anywheresoftware.b4j.object.ServerWrapper.Start(Unknown Source)
at b4j/com.genesis.rfidinventory.main._btnstartserver_click(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)
... 9 more
this happens as soon as I press on the Start Server button which basically starts the server
B4X:
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private srvr As Server
    Public SQL1 As SQL
    Private btnStartServer As Button
    Private txtLogs As TextArea
    ''Private ip As ServerSocket
    Private lblIP As Label
    Private RFIDTable As B4XTable
    Private BarCodeTable As B4XTable
    Private xui As XUI
End Sub

Sub btnStartServer_Click
    srvr.Start
End Sub
Why would this be?

Thanks,
Walter
 

jmon

Well-Known Member
Licensed User
What are you using jServer for?
I have the same problem. I was using jServer for the Pool & MySQL connector. What is the replacement for that? HikariCP?
 

jmon

Well-Known Member
Licensed User
Please tell me whether it worked.
Thank you but I still get the same error:
B4JPackager11 Version 1.11
InputJar: xxxxxx\Client\Packager\PostChat\PostChat.jar
Running: xxxxxx\Client\Packager\B4JPackager11\Objects\temp\FindDosPath.exe
Running: C:\Program Files\Java\jdk-11.0.1\jdk-11.0.1\bin\jar
Package name: com.xxxxxx
Running: C:\Program Files\Java\jdk-11.0.1\jdk-11.0.1\bin\jdeps
.
.
.
.
.
Explicitly excluded modules: []
Included modules: [java.base, java.datatransfer, java.desktop, java.instrument, java.logging, java.management, java.management.rmi, java.naming, java.rmi, java.scripting, java.security.jgss, java.sql, java.transaction.xa, java.xml, javafx.base, javafx.controls, javafx.fxml, javafx.graphics, javafx.media, javafx.swing, javafx.web, jdk.jsobject, jdk.management, jdk.unsupported, jdk.unsupported.desktop, jdk.xml.dom]
Running: C:\Program Files\Java\jdk-11.0.1\jdk-11.0.1\bin\javac
.
.
module-info.java:32: error: cannot find symbol
uses javax.websocket.server.ServerEndpointConfig$Configurator;
^
symbol: class ServerEndpointConfig$Configurator
location: package javax.websocket.server
module-info.java:35: error: cannot find symbol
uses org.eclipse.jetty.io.ssl.ALPNProcessor$Server;
^
symbol: class ALPNProcessor$Server
location: package org.eclipse.jetty.io.ssl
2 errors
These are my libraries:
Capture.PNG

Thank you for your help. I'm a bit late for the switch to JDK 11!

[EDIT} sorry I noticed I didn't update jGoogleMaps, doing it now
 
Last edited:

jmon

Well-Known Member
Licensed User
Have you recompiled your app with jConnectionPool instead of jServer?
Yes I did, and I still have the same problem.

I also noticed I didn't update jGoogleMaps. I updated now, and set "AdditionalModuleInfoString" but that doesn't solve the problem.

edit: I also changed jControlsFX to jControlsFX9
 

jmon

Well-Known Member
Licensed User
Try this. Create a new app. Add jConnectionPool and compile it. Can you build a package for this app?
Yes that works. I'll have a look at each of my libraries and see which one causes the problem and report back here. Thank you
 

jmon

Well-Known Member
Licensed User
Can you make a package of a new app with jConnectionPool selected?
Ok, I found the problem. One of my library had jServer selected (and not used!). I recompiled the library without jServer, and now everything works :D
So this jConnectionPool library works well. Thank you!
 
Top