B4J Question [BANano] BVAD3 PHP Connection Tester

Mashiane

Expert
Licensed User
Good morning

UPDATE: 25 August 2021 - The MySQL Connect utility is now part of the New Awesome Kitchen Sink.

Download

bvad3success.jpg



I kindly request your help. I am not a PHP expert and without having to resolute to "well, it works on my pc". Houston we have a problem!

I have done a couple of deployments of my BANano + PHP WebApp which are working fine for now.

With due respect, this is a PHP challenge and not a jetty challenge, please bear that in mind.

The purpose of the attached app is to check of you are able to

1. Connect to your backend database via PHP, whether you are working on a local development server or remote.
2. Whether you are able to access your BANano WebApp from your local development or remote webserver. The app on this download.
3. The steps are easy I hope.
4. We kindly request that you please run the tests and then come back here and reflect about your experiment.

What you need to do to make this work.

1. Download and install the BVAD3 library to your external libraries. Use the one from the provided download link above.
2. If you dont have banano installed, please set it up from here.
3. If you dont have a development webserver, please set up one
4, If you are using xampp, on the Main module, change your publish variable to use Xampp and change the \ to //
5. Open the mysqlconfig.php file and update it to reflect your MySQL connection settings.

1621845088961.png


6. On the Main module, change the ServerIP variable to be where your app is running from.

1621845226470.png


7. On pgIndex, change the dbname to be the actual name of your database

1621845466539.png


8. Ensure that your inbound & outbound tcp/ip connections to port 336 are set to be allowed on your firewall.
9. Grant Access for your MySQL user should be set to % for all IP addresses.

If you are running localhost with SSL, your ServerIP should be https otherwise it should be http.

For your remote host, you can also use localhost as the php file will be called from that machine. Also your DB_HOST can be localhost if the database is on the same machine, otherwise use the IP address of your web server.

If you dont have a successful connection, please indicate. Did you use an ip address / domain name / localhost for your connection, what is the error? What are the apache error logs saying etc.

What will this do and help with?

We have received indications that BVAD3 with PHP does not work and would like to get the details about cases why it does not work and possible solutions. In one of the cases, even a pure breed BANano PHP app could not connect whilst the php script run perfectly on the browser.

We are still investigating whether this is the source code we are writing or something else out of the ordinary and want to find out what we are missing and possibly doing wrong, and why in one instance, deployments work without issues and then for others nothing works.

As an example, if we use an ip address in BANAno.PHPHost, we get server errors, whilst using a domain name for the same everything works without hurdles.

I thank you.

🙏
 
Last edited:

José J. Aguilar

Expert
Licensed User
I'm using the b4xlib file in your first download link. With "external libraries" you mean "Additional libraries", right?

1621871947365.png


There I have:

BANanoMaterialDesignIcons.b4xlib
BANanoRoboto.b4xlib
BANanoVuetifyAD3.b4xlib

Also for us to be on the same page, now that you are using laragon, please if you dont mind, please ensure you have done all this,
I'm using Laragon for other projects. I think it's set up just like you. In the link you say, there no special config for BANANO I think. Just the SQLite3 extension? (I got it)

Thanks
 
Upvote 0

José J. Aguilar

Expert
Licensed User
Ok, my fault, I copied your 3 libraries to internal instead of external.

Now in debug mode I get this log:

B4X:
Waiting for debugger to connect...
Program started.
Reading B4J INI in C:\Users\Admin2\AppData\Roaming\Anywhere Software\B4J to find Additional Libraries folder...
Found Additional Libraries folder: C:\Users\Admin2\Documents\LibreriasAdicionales
Starting to transpile...
Building C:\laragon\www\bvad4\scripts\app.js
Loading layout bvad4baseline...
Processing b4xlib: bananoroboto
java.io.FileNotFoundException: C:\Users\Admin2\DOWNLO~1\WebApp\Objects\b4xlibs_BANano\bananoroboto\B4J\manifest.txt (El sistema no puede encontrar la ruta especificada)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
    at java.base/java.io.FileReader.<init>(FileReader.java:60)
    at com.ab.banano.BANano.ProcessB4XLib(Unknown Source)
    at com.ab.banano.BANano.a(Unknown Source)
    at com.ab.banano.BANano.a(Unknown Source)
    at com.ab.banano.BANano.Build(Unknown Source)
    at b4j.example.main._appstart(main.java:157)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at b4j.example.main.start(main.java:38)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:834)
Processing b4xlib: bananovuetifyad3
java.io.FileNotFoundException: C:\Users\Admin2\DOWNLO~1\WebApp\Objects\b4xlibs_BANano\bananovuetifyad3\B4J\manifest.txt (El sistema no puede encontrar la ruta especificada)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
    at java.base/java.io.FileReader.<init>(FileReader.java:60)
    at com.ab.banano.BANano.ProcessB4XLib(Unknown Source)
    at com.ab.banano.BANano.a(Unknown Source)
    at com.ab.banano.BANano.a(Unknown Source)
    at com.ab.banano.BANano.Build(Unknown Source)
    at b4j.example.main._appstart(main.java:157)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at b4j.example.main.start(main.java:38)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:834)
java.io.FileNotFoundException: C:\Users\Admin2\DOWNLO~1\WebApp\Objects\b4xlibs_BANano\bananomaterialdesignicons\B4J\manifest.txt (El sistema no puede encontrar la ruta especificada)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
    at java.base/java.io.FileReader.<init>(FileReader.java:60)
    at com.ab.banano.BANano.ProcessB4XLib(Unknown Source)
    at com.ab.banano.BANano.a(Unknown Source)
    at com.ab.banano.BANano.a(Unknown Source)
    at com.ab.banano.BANano.Build(Unknown Source)
    at b4j.example.main._appstart(main.java:157)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at b4j.example.main.start(main.java:38)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:834)
java.io.FileNotFoundException: C:\Users\Admin2\DOWNLO~1\WebApp\Objects\b4xlibs_BANano\bananomaterialdesignicons\B4J\manifest.txt (El sistema no puede encontrar la ruta especificada)
    at java.base/java.io.FileInputStream.open0(Native Method)
    at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
    at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
    at java.base/java.io.FileReader.<init>(FileReader.java:60)
    at com.ab.banano.BANano.ProcessB4XLib(Unknown Source)
    at com.ab.banano.BANano.a(Unknown Source)
    at com.ab.banano.BANano.a(Unknown Source)
    at com.ab.banano.BANano.Build(Unknown Source)
    at b4j.example.main._appstart(main.java:157)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:632)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:91)
    at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:78)
    at b4j.example.main.start(main.java:38)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
    at java.base/java.lang.Thread.run(Thread.java:834)
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method CallAjaxWait will not work in old browsers!
[WARNING]: The method AddEventlistenerOpenAsync will not work in old browsers!
[WARNING]: The method ThenWait will not work in old browsers!
[WARNING]: The method ElseWait will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method CallAjaxWait will not work in old browsers!
[WARNING]: The method AddEventlistenerOpenAsync will not work in old browsers!
[WARNING]: The method ThenWait will not work in old browsers!
[WARNING]: The method ElseWait will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method Await will not work in old browsers!
[WARNING]: The method showswalinputwait will not work in old browsers!
[WARNING]: The method showswalconfirmwait will not work in old browsers!
[WARNING]: The method onmounted will not work in old browsers!
[WARNING]: The method getwait will not work in old browsers!
[WARNING]: The method postwait will not work in old browsers!
[WARNING]: The method putwait will not work in old browsers!
[WARNING]: The method deletewait will not work in old browsers!
[WARNING]: The method patchwait will not work in old browsers!
[WARNING]: The method callinlinephpwait will not work in old browsers!
[WARNING]: The method callinlinephpwait will not work in old browsers!
[WARNING]: The method download will not work in old browsers!
[WARNING]: The method uploadfilewait will not work in old browsers!
[WARNING]: The method callinlinephpwait will not work in old browsers!
[WARNING]: The method showswalinputwait will not work in old browsers!
[WARNING]: The method showswalconfirmwait will not work in old browsers!
[WARNING]: The method onmounted will not work in old browsers!
[WARNING]: The method getwait will not work in old browsers!
[WARNING]: The method postwait will not work in old browsers!
[WARNING]: The method putwait will not work in old browsers!
[WARNING]: The method deletewait will not work in old browsers!
[WARNING]: The method patchwait will not work in old browsers!
[WARNING]: The method callinlinephpwait will not work in old browsers!
[WARNING]: The method callinlinephpwait will not work in old browsers!
[WARNING]: The method download will not work in old browsers!
[WARNING]: The method uploadfilewait will not work in old browsers!
[WARNING]: The method callinlinephpwait will not work in old browsers!
[WARNING]: The method showswalinputwait will not work in old browsers!
[WARNING]: The method showswalconfirmwait will not work in old browsers!
Copying CSS files to WebApp assets...
Copying Javascript files to WebApp assets...
Building C:\laragon\www\bvad4\index.html
Done! Live Code Swapping is active...

But it works¡¡

1621872496671.png
 
Upvote 0

Mashiane

Expert
Licensed User
In case you have 500 Internal Server Errors, please ensure that this is also running on your server BVAD3 does not work without it.

1622667760955.png


The attached file when installed will give your your PHP install info.

Now I know this is where to start in debugging this monster. It can be a very terrible headache. If you use laragon, check your server with the laragon setup.

NB: Please note Im no PHP expert and I wont be able to provide much help with any of this, thus its important to have a handy person to help with your webserver admin tasks.

Ta!
 

Attachments

  • infox.zip
    171 bytes · Views: 72
Upvote 0
Top