B4J Question How to use B4J Jar create a WEB app

Dogbonesix

Active Member
Licensed User
Longtime User
I have two teams trying to to install a B4J Jar as a WEB app. Team one, using Tomcat on a AWS server where the data is linked to a separate data source. The app can be accessed at svn.cgumpdesign.com and works (sorta). Just leave the Login and PWD blank - it will run a Sample dataset. While It does runs the connection is not secure. Although usable it is not user friendly - requires the user to accept Pop-Ups which confuses most people. The other team also using Tomcat on a JustHost server. The JustHost server had to use a skeleton Cpanel to install Tomcat. But Tomcat is installed. The JustHost server has the the site Grok3.com. Grok3.com is secure and all resources (data) can be contained but at the moment uses the same data link. It does not run. Try Grok3.com and you will see the splash screen but it will not execute beyond. This error does occur "websocket connection to 'ws:grok3.com:8082/ws' failed: reconnecting-websocket.js:209".

GENEROUS donation for a resolution.
 

tchart

Well-Known Member
Licensed User
Longtime User
@Dogbonesix some more context would help.

B4J web apps with jServer are there own web app so it has nothing to do with Tomcat.

If the Web App you are referring to is a Banano web app (ie html + javascript) then thats not really a B4J web app as its just html+javascript at the end of the day.

However it sounds like your second host may be blocking web sockets. I know on MS Azure you specifically have to enable web socket traffic so its possible that your host is block the web socket traffic.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
I agree with @tchart .
Follow the tutorials:

Thread '[Server] Building web servers with B4J'
https://www.b4x.com/android/forum/threads/server-building-web-servers-with-b4j.37172/

B4J server app doesn’t require additional web server. It is a web server itself powered by Jetty.

Thread '[server] Run a Server on a VPS'
https://www.b4x.com/android/forum/threads/server-run-a-server-on-a-vps.60378/


To run it just a matter of calling the jar file using JDK. I have many live demos in my VPS and I don’t need Apache, IIS or Tomcat.
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
Maybe he is using TomCat as a reverse proxy to accept requests and divert them to the relevant apps. When I was researching it something that blew my mind (with nginx at least) is that it provides an https access to the outside world but communicates internally with the jServer apps with http. Maybe something relevant could be the problem.

Edit - Then again it could be just a firewall issue.
Edit 2 - "Maybe something relevant could be the problem" <- This is not a problematic behaviour with nginx but it may induce some issues in special cases according to my understanding.
 
Last edited:
Upvote 0
Top