B4J Question jServer-11.0.20 & jServer-11.0.21 packaging error

Chris2

Active Member
Licensed User
Longtime User
I've been trying out the updated versions of jServer posted by @tchart here (thanks for posting these @tchart!)
I've had no problems running my jRDC2 based app in debug & release mode but get the following errors when trying to build a standalone package:
Packaging error 1 with jserver-11.0.21:
B4JPackager11 Version 1.40
:
:
Non-UI program
:
Running: C:\Java\jdk-17.0.10\bin\jdeps
.
Exception in thread "main" java.lang.module.FindException: Module org.eclipse.jetty.http2.hpack not found, required by org.eclipse.jetty.http2.common
    at java.base/java.lang.module.Resolver.findFail(Resolver.java:893)
    at java.base/java.lang.module.Resolver.resolve(Resolver.java:192)
    at java.base/java.lang.module.Resolver.resolve(Resolver.java:141)
    at java.base/java.lang.module.Configuration.resolve(Configuration.java:421)
    at java.base/java.lang.module.Configuration.resolve(Configuration.java:255)
    at jdk.jdeps/com.sun.tools.jdeps.JdepsConfiguration$Builder.build(JdepsConfiguration.java:564)
    at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.buildConfig(JdepsTask.java:603)
    at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:557)
    at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:533)
    at jdk.jdeps/com.sun.tools.jdeps.Main.main(Main.java:49)

Packaging error 2 with jServer-11.0.20:
B4JPackager11 Version 1.40
:
:
Running: C:\Java\jdk-17.0.10\bin\jar
Non-UI program
:
Running: C:\Java\jdk-17.0.10\bin\jdeps
.
Exception in thread "main" java.lang.module.FindException: Module org.slf4j not found, required by org.eclipse.jetty.http2.common
    at java.base/java.lang.module.Resolver.findFail(Resolver.java:893)
    at java.base/java.lang.module.Resolver.resolve(Resolver.java:192)
    at java.base/java.lang.module.Resolver.resolve(Resolver.java:141)
    at java.base/java.lang.module.Configuration.resolve(Configuration.java:421)
    at java.base/java.lang.module.Configuration.resolve(Configuration.java:255)
    at jdk.jdeps/com.sun.tools.jdeps.JdepsConfiguration$Builder.build(JdepsConfiguration.java:564)
    at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.buildConfig(JdepsTask.java:603)
    at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:557)
    at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:533)
    at jdk.jdeps/com.sun.tools.jdeps.Main.main(Main.java:49)

The app still packages correctly with the original jServer v4.0 version supplied internally within the latest B4J.

Can anyone tell me what's causing these packaging errors and how I can fix them?
Do I need to add an extra #PackagerProperty?

I already have all the #PackagerProperty settings from the jServer v4.0 thread:
B4X:
    #PackagerProperty: AdditionalModuleInfoString = provides org.slf4j.spi.SLF4JServiceProvider with org.eclipse.jetty.logging.JettyLoggingServiceProvider;
    #PackagerProperty: AdditionalModuleInfoString = provides org.eclipse.jetty.io.ssl.ALPNProcessor.Server with org.eclipse.jetty.alpn.java.server.JDK9ServerALPNProcessor;
    #PackagerProperty: AdditionalModuleInfoString = provides org.eclipse.jetty.http.HttpFieldPreEncoder with org.eclipse.jetty.http2.hpack.HpackFieldPreEncoder, org.eclipse.jetty.http.Http1FieldPreEncoder;
    #PackagerProperty: AdditionalModuleInfoString = uses org.eclipse.jetty.util.security.CredentialProvider;
    #PackagerProperty: AdditionalModuleInfoString = uses org.eclipse.jetty.io.ssl.ALPNProcessor.Server;
    #PackagerProperty: IncludedModules = jdk.charsets, jdk.crypto.ec

Many thanks.


Solution Update: As well as the post marked as the solution, see also post #8 for an explanation of how the errors above were solved by @teddybear .
Update 2: As well as those listed in @teddybear's solution, I had to add java.desktop to the list of includedModules (#PackagerProperty: IncludedModules =...) to prevent an error (java.lang.NoClassDefFoundError: java/beans/PropertyChangeListener) when running the app from the package.
(possibly needed only with an MS SQL Server database in use)
 
Last edited:
Solution
To build a standalone package using jserver-11.0.21, you need to adapt some packages of the library for that.
1. A modified jserver-11.0.21 is attached
2.Add some modules to PackagerProperty if they are necessary
B4X:
#PackagerProperty: IncludedModules = jdk.charsets, jdk.crypto.ec,java.sql,java.instrument,java.xml,java.security.jgss,java.rmi,java.naming,java.management

tchart

Well-Known Member
Licensed User
Longtime User
Hi @Chris2 I dont use B4JPackager11 so Im only assuming here. Did you download the version I posted or did you configure it yourself?

Can you confirm youve got the jar files for http2?

1721069922688.png

And that its shown in the XML?

1721070011935.png
 
Upvote 0

Chris2

Active Member
Licensed User
Longtime User
Thanks for your help @tchart.
I downloaded directly from your post, and all looks OK with the jar files & in the XML:
jServer11.0.21Folder.png


jServer11.0.21XML.png


Update: Just to be clear, at this point I am still getting the same errors mentioned in my first post.
 
Last edited:
Upvote 0

teddybear

Well-Known Member
Licensed User
To build a standalone package using jserver-11.0.21, you need to adapt some packages of the library for that.
1. A modified jserver-11.0.21 is attached
2.Add some modules to PackagerProperty if they are necessary
B4X:
#PackagerProperty: IncludedModules = jdk.charsets, jdk.crypto.ec,java.sql,java.instrument,java.xml,java.security.jgss,java.rmi,java.naming,java.management
 
Upvote 0
Solution

Chris2

Active Member
Licensed User
Longtime User
That seems to have sorted the problem for me, thanks @teddybear! With your jServer-11.0.21 version I can now package jRDC2.

For everyone's information can you say please what you changed within the jServer-11.0.21 files?
Based on the file modified dates, it looks to me like you've altered something in jetty-io-11.0.21.jar, jetty-alpn-java-server-11.0.21.jar, http2-server-11.0.21.jar, http2-hpack-11.0.21.jar, http2-common-11.0.21.jar, & jetty-alpn-server-11.0.21.jar?
 
Upvote 0

teddybear

Well-Known Member
Licensed User
What I did was remove
@teddybear i’m also interested to know what you changed :)
That seems to have sorted the problem for me, thanks @teddybear! With your jServer-11.0.21 version I can now package jRDC2.

For everyone's information can you say please what you changed within the jServer-11.0.21 files?
Based on the file modified dates, it looks to me like you've altered something in jetty-io-11.0.21.jar, jetty-alpn-java-server-11.0.21.jar, http2-server-11.0.21.jar, http2-hpack-11.0.21.jar, http2-common-11.0.21.jar, & jetty-alpn-server-11.0.21.jar?
What I did was remove the module info from these jars. and you can also do that for jserver-11.0.20.
 
Last edited:
Upvote 1

tchart

Well-Known Member
Licensed User
Longtime User
In case you want to do this yourself, heres a batch file that will remove the file from all jar files in a directory using 7za.

INI:
@echo off

SET ZA=C:\Apps\7za\7za.exe

FOR /F "tokens=*" %%G IN ('dir /b *.jar') DO %ZA% d %%G module-info.class

pause
 
Upvote 0
Top