B4J Question (SOLVED) module b4j does not declare `uses`

Johan Schoeman

Expert
Licensed User
Longtime User
I am trying to compile a B4J project (Java 11) to a standalone package. It compiles fine but when running "run_debug" I get the following error. I guess it requires some PackagerProperty to be added to the B4J project? Can someone please advise what should be added to the B4J project?

B4X:
C:\Users\johans\Documents\B4JApps\WebCamScanBarcode\WebCam\Objects\temp\build>cd bin

C:\Users\johans\Documents\B4JApps\WebCamScanBarcode\WebCam\Objects\temp\build\bin>java.exe @release_java_modules.txt  -m b4j/b4j.example.main
sarxoswebcam._initialize (java line: -1)
java.util.ServiceConfigurationError: org.slf4j.spi.SLF4JServiceProvider: module b4j does not declare `uses`
 

Johan Schoeman

Expert
Licensed User
Longtime User
Is this the full error message?
Erel, this is the full error:


Full B4J error code:
C:\Users\johans\Documents\B4JApps\WebCamScanBarcode\WebCam\Objects\temp\build\bin>java.exe @release_java_modules.txt  -m b4j/b4j.example.main
sarxoswebcam._initialize (java line: -1)
java.util.ServiceConfigurationError: org.slf4j.spi.SLF4JServiceProvider: 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.slf4j.LoggerFactory.findServiceProviders(Unknown Source)
        at b4j/org.slf4j.LoggerFactory.bind(Unknown Source)
        at b4j/org.slf4j.LoggerFactory.performInitialization(Unknown Source)
        at b4j/org.slf4j.LoggerFactory.getProvider(Unknown Source)
        at b4j/org.slf4j.LoggerFactory.getILoggerFactory(Unknown Source)
        at b4j/org.slf4j.LoggerFactory.getLogger(Unknown Source)
        at b4j/org.slf4j.LoggerFactory.getLogger(Unknown Source)
        at b4j/com.github.sarxos.webcam.Webcam.<clinit>(Unknown Source)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Unknown Source)
        at b4j/anywheresoftware.b4j.object.JavaObject.getCorrectClassName(Unknown Source)
        at b4j/anywheresoftware.b4j.object.JavaObject.InitializeStatic(Unknown Source)
        at b4j/b4j.example.sarxoswebcam._initialize(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.start(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(Unknown Source)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(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)


C:\Users\johans\Documents\B4JApps\WebCamScanBarcode\WebCam\Objects\temp\build\bin>pause
Press any key to continue . . .
 
Upvote 0
Top