B4J Question [BANanoServer] Not Able To Serve up a BVAD3 Site

B4XDev

Member
Licensed User
I've got an nginx reverse proxy on a Windows box serving up some B4J and BANano servers.

@aeric 's API site works fine. It connects to MySQL, as well. Seemingly no obvious issues...

I can't get @alwaysbusy 's BANanoServer to serve up @Mashiane 's BVAD3 server.

Here's what I get:

banano_issue.png


So... it almost comes up! Something is coming through...

But why doesn't it finish?

I'm guessing it has something to do with the websocket functionality. Maybe something is blocking the front-end's ability to contact the back-end, or vice versa?

I'm stuck here and have been for many days... so if anybody has any ideas, please let me know!
 

B4XDev

Member
Licensed User
Additional information: I'm actually able to run the B4J server with the same (or similar-enough) nginx config file, as you can see here: B4XDev.com.

The websockets are actually working there, so I'm not sure if websockets are really the issue. They still could be, depending on what BANanoServer is doing... maybe... I have no idea.
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
Note hat BANanoServer is just a wrap around the normal B4J jServer with some convenient methods and classes prepared. As it is a .b4xlib, you can simply unzip it and look into the source code.

Things you can try to identify the problem:
1. open it in chrome, press F12 and look if the browsers console does show errors (missing files?)
2. are there any errors in the B4J log?
3. Do your class names have the proper BROWSER or SERVER prefixes?
4. look into the Kitchen Sink example Mashiane has mad how things are done: https://github.com/Mashiane/BANanoVuetifyAD3/blob/main/BVAD3Server.zip I believe this is a BANanoServer + BDAV3

Alwaysbusy
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
1. open it in chrome, press F12 and look if the browsers console does show errors (missing files?)
2. are there any errors in the B4J log?
Thanks Alain, surely checking those logs will provide us green lights in terms of the underlying issues especially the web logs in this particular case.

In other news...

 
Upvote 0

B4XDev

Member
Licensed User
Things you can try to identify the problem:
1. open it in chrome, press F12 and look if the browsers console does show errors (missing files?)

The only error in Brave browser console is: "Uncaught vform1: Error - the recordsource name has not been specified"

That has to be where it's breaking, but I'm not sure what it means.

2. are there any errors in the B4J log?

Not that I can tell:

Log Read Out:
2021-11-05 08:10:20.973:INFO::main: Logging initialized @23859ms to org.eclipse.jetty.util.log.StdErrLog
2021-11-05 08:10:21.108:INFO:oejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 11.0.1+13
2021-11-05 08:10:21.129:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2021-11-05 08:10:21.129:INFO:oejs.session:main: No SessionScavenger set, using defaults
2021-11-05 08:10:21.131:INFO:oejs.session:main: node0 Scavenging every 660000ms
2021-11-05 08:10:21.147:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@2e3967ea{/,file:///C:/Projects/B4X/BVA/BVAD3Server/BVAD3Server/Objects/www/,AVAILABLE}
2021-11-05 08:10:21.150:INFO:oejs.AbstractNCSARequestLog:main: Opened C:\Projects\B4X\BVA\BVAD3Server\BVAD3Server\Objects\logs\b4j-2021_11_05.request.log
2021-11-05 08:10:21.261:INFO:oejs.AbstractConnector:main: Started ServerConnector@402c4085{HTTP/1.1,[http/1.1]}{0.0.0.0:55056}
2021-11-05 08:10:21.262:INFO:oejs.Server:main: Started @24150ms
2021-11-05 08:10:21.326:INFO:oejs.AbstractConnector:main: Stopped ServerConnector@402c4085{HTTP/1.1,[http/1.1]}{0.0.0.0:55056}
2021-11-05 08:10:21.327:INFO:oejs.session:main: node0 Stopped scavenging
2021-11-05 08:10:21.328:INFO:oejsh.ContextHandler:main: Stopped o.e.j.s.ServletContextHandler@2e3967ea{/,file:///C:/Projects/B4X/BVA/BVAD3Server/BVAD3Server/Objects/www/,UNAVAILABLE}
2021-11-05 08:10:21.331:INFO:oejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 11.0.1+13
2021-11-05 08:10:21.333:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@2e3967ea{/,file:///C:/Projects/B4X/BVA/BVAD3Server/BVAD3Server/Objects/www/,AVAILABLE}
2021-11-05 08:10:21.333:INFO:oejs.AbstractNCSARequestLog:main: Opened C:\Projects\B4X\BVA\BVAD3Server\BVAD3Server\Objects\logs\b4j-2021_11_05.request.log
2021-11-05 08:10:21.334:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2021-11-05 08:10:21.334:INFO:oejs.session:main: No SessionScavenger set, using defaults
2021-11-05 08:10:21.334:INFO:oejs.session:main: node0 Scavenging every 660000ms
2021-11-05 08:10:21.338:INFO:oejs.AbstractConnector:main: Started ServerConnector@402c4085{HTTP/1.1,[http/1.1]}{0.0.0.0:55056}
2021-11-05 08:10:21.338:INFO:oejs.Server:main: Started @24227ms
2021-11-05 08:10:21.339:INFO:oejs.session:main: node0 Scavenging every 60000ms
Port: 55056
Nov 05, 2021 8:10:21 AM com.mchange.v2.log.MLog
INFO: MLog clients using java 1.4+ standard logging.
Nov 05, 2021 8:10:21 AM com.mchange.v2.c3p0.C3P0Registry
INFO: Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
jRDC is running (version = 2.22)
Opening site with http://localhost
Saving the first instance

The site pops up in the browser, it just isn't complete.


3. Do your class names have the proper BROWSER or SERVER prefixes?
4. look into the Kitchen Sink example Mashiane has mad how things are done: https://github.com/Mashiane/BANanoVuetifyAD3/blob/main/BVAD3Server.zip I believe this is a BANanoServer + BDAV3

I'm actually using the Kitchen Sink as a test case for a web app project we're trying to get done.

Looks like a BVAD3 issue, so I'll continue debugging with @Mashiane .

Thanks for the help!
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Please follow Step 3 of this post as is.
Please follow this post...


Then update the config.properties file like this. You access this via the Files Tab of your b4j project.

B4X:
Host=http://localhost
Port=55056
PortSSL=0

Save and run the application, DO A HARD REFRESH of your browser.

1636116298953.png
 
Last edited:
Upvote 0

B4XDev

Member
Licensed User
Please follow Step 3 of this post as is.


Step 3:


Done.


Confirmed.


Got it.

  • This deployment test should work for all other BANanoVuetifyAD3 BANanoServer projects


Then update the config.properties file like this. You access this via the Files Tab of your b4j project.

B4X:
Host=http://localhost
Port=55056
PortSSL=0

Save and run the application, DO A HARD REFRESH of your browser.

Done.

Here's the current error:

1636117244045.png
 
Upvote 0

B4XDev

Member
Licensed User
How do I test it on a non-secure connection? I'm on a local Windows PC with no way to secure it (no domain pointing to it).
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
How do I test it on a non-secure connection? I'm on a local Windows PC with no way to secure it (no domain pointing to it).
Post 6 above is on a non-secure connection.

Thing is the posted source code for the Kitchen Sink also speaks to secure-connections, you just need to update the config.properties files for a non-secure connection, that's all.
 
Upvote 0

B4XDev

Member
Licensed User
Post 6 above is on a non-secure connection.

Thing is the posted source code for the Kitchen Sink also speaks to secure-connections, you just need to update the config.properties files for a non-secure connection, that's all.

It seems the websocket is attempting a secure connection.

1636119087034.png


If I modify BROWSERIndex, line 143, to read:

B4X:
ws.Initialize("ws://" & BANano.Location.GetHost & "/ws/" & BANano.StaticFolder & "/index")

instead of

B4X:
ws.Initialize("wss://" & BANano.Location.GetHost & "/ws/" & BANano.StaticFolder & "/index")

I still get the WebSocket failure message as above.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Lets try it once more...

Your browser is still using a cached version of BVAD3Server Kitchen Sink, unless...
  • Please, just recheck this line on BrowserIndex
B4X:
ws.Initialize("ws://" & BANano.Location.GetHost & "/ws/" & BANano.StaticFolder & "/index")
  • Open the windows task manager, kill all instances of java.exe or if you can find the one instance the bvad3server is running on, kill it.
  • In the BVAD3 Project, goto tools and click clean project.
  • Delete the compiled Objects folder on the BVAD3 project.
  • Run the BVAD3Server project again (in release mode)
  • When the browser opens, do a hard refresh of the browser.
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Shouldn’t the url be wss://localhost:55056/ws/ ...
Nope, that is applicable to this version

 
Upvote 0
Top