B4J Question ABMaterial: java.nio.channels.ClosedChannelException - how to suppress

JackKirk

Well-Known Member
Licensed User
Longtime User
When I run my ABMaterial web app in release mode I am randomly(?) getting messages of the form:
According to Erel at:
https://www.b4x.com/android/forum/t...nels-closedchannelexception.99931/post-628850
they can be ignored.

But they are messing up my real time log, can anyone give me some guidance on how to suppress them.

Thanks in anticipation...
 

JackKirk

Well-Known Member
Licensed User
Longtime User
I'm confused. my app's library settings seem to be:

Name Version Online Path Platform
jServer 4.01 4.03 Internal B4J

Am I on 4.01 or 4.03?

When I turn this entry off, among the available libraries appears:

jServer 4.03 Internal B4J

But if I check that I get the first entry again.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Am I on 4.01 or 4.03?
4.01

Update jserver library


Make sure to copy the files to the internal library folder.
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Thanks Don Manfred - I have updated jServer library to 4.03

I'm still confused about what I need to do with b4j_ws.zip - is this in jServer 4.03 or do I have to incorporate it somehow?
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
I successfully upgraded to jServer 4.03 but am still getting the ClosedChannelException error in my logs.

I added:
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
#CustomBuildAction: After Packager, %WINDIR%\System32\robocopy.exe, www temp\build\bin\www /E
to the #Region Project Attributes of my b4j apps

But I don't use the standalone packager to create an .exe - I use B4JBuilder to create a .jar

I'm assuming the #Region Project Attributes stuff needs altering but how?

Thanks...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
to the #Region Project Attributes of my b4j apps

But I don't use the standalone packager to create an .exe - I use B4JBuilder to create a .jar

I'm assuming the #Region Project Attributes stuff needs altering but how?
It is not related. You don't need to make any change.

Can you post the logs?
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Can you post the logs?
I think I'm embarrassed - for experimentation purposes I have 2 B4J ABMaterial web apps running on a single AWS EC2 behind an AWS Application Load Balancer - I think I must have recompiled one of them twice and the other nonest.

After recompiling both they now seem to be behaving.

Thanks for your patience...
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
Can you post the logs?
I spoke too soon, in my logs I am still getting:
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
I don't know if this is any help but it seems to be mainly/only(?) happening when I am using javascript to jump from a webpage in my app to something external, these are the js statements that do that:
B4X:
var url = 'xxx://' + wrkguid;
window.location.href = url;

var url = 'https://play.google.com/store/apps/details?id=treetops.app.customer&hl=en&gl=US&referrer=' + wrkguid;
window.open(url, '_blank');

var url = 'https://itunes.apple.com/us/app/treetops-smart-photo-customer/id1405937870?ls=1&mt=8';
window.open(url, '_blank');
the jumps always work though.
 
Upvote 0

JackKirk

Well-Known Member
Licensed User
Longtime User
If you can reproduce it in a small project then I will probably be able to solve it.
Thanks for the offer Erel but this just keeps getting weirder.

I was initially running a set up like this:

...............user on browser
............................... |
..........................HTTPS
............................... |
...............................V
AWS Application Load Balancer
...............|................................|
........HTTPS.....................HTTPS
...............|................................|
..............V..............................V
WebServer01........WebServer02....<--- both on same AWS EC2 instance, using LetsEncrypt


so I could avoid having to use LetsEncrypt (just another potential failure point) I transitioned my code and set up to:

...............user on browser
............................... |
..........................HTTPS
............................... |
...............................V
AWS Application Load Balancer
...............|................................|
........HTTP.......................HTTP....<--- change
...............|................................|
..............V..............................V
WebServer01........WebServer02....<--- both on same AWS EC2 instance, NOT using LetsEncrypt

which is apparently a quite common setup.

But now during testing on 4 devices (2 iPhones and 2 Pixels) the problem seems to have disappeared.

Is this a possible result or am I just premature in my reporting?
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…