B4J Question jRDC Getting Started

mmieher

Active Member
Licensed User
Longtime User
I need to run this on a remote server, so I installed B4J on the server. Downloaded and installed the JDK and mySql jDBC connector. When running jRDC from B4J everything looks fine:
Log:
Waiting for debugger to connect...
Program started.
Emulated network latency: 100ms
jRDC is running (version = 2.1)

When I installed Java from Oracle, it gave me a 64-bit version and put it in "Program Files" instead of "Program Files(x86)", so I had to modify the command below:

C:\Program Files\Java\jdk-9.0.1>java -Xmx256m -cp .;libs\*;jdnc_driver\* anywheresoftware.b4a.remotedatabase.remoteserver
Error: Could not find or load main class anywheresoftware.b4a.remotedatabase.remoteserver

I suspect I need to replace the class with something else but have no idea what to put there.

When I go to a browser http://127.0.0.1/?method=test I get a 404. Request Log:

127.0.0.1 - - [12/Nov/2017:09:29:34 +0000] "GET /?method=test HTTP/1.1" 404 315 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36"

I get the same thing with method=query. I have not changed anything in jRDC.b4a except config.properties.

Marc
 

OliverA

Expert
Licensed User
Longtime User
As long as you have #MergeLibraries: True option set, you should just be able to do
java -Xmx256m -jar jRDC.jar
, with the assumption that you are in the same directory as the .jar file (and java.exe can be executed from anywhere, it's bin folder is the the PATH environment variable). The jar file will be located in the Objects folder of your project folder (after using Release or Release (obfuscated) as your build option).

The URL for the test site should be (on same machine as jRDC is running)
, where xxxxx is the port that is setup in your config.properties file.
 
Upvote 0

mmieher

Active Member
Licensed User
Longtime User
As long as you have #MergeLibraries: True option set, you should just be able to do, with the assumption that you are in the same directory as the .jar file (and java.exe can be executed from anywhere, it's bin folder is the the PATH environment variable). The jar file will be located in the Objects folder of your project folder (after using Release or Release (obfuscated) as your build option).

The URL for the test site should be (on same machine as jRDC is running), where xxxxx is the port that is setup in your config.properties file.

Thank you so much, Oliver! This got me going. I am very new to B4J. Took me awhile to figure out that I had to run in Release Mode to create the .jar.

When I go to http://127.0.0.1:17178/test I see "RemoteServer is running", but next line says "Error fetching connection". Any idea what this means? I am trying to connect to mySql.
 
Upvote 0

mmieher

Active Member
Licensed User
Longtime User
Thank you so much, Oliver! This got me going. I am very new to B4J. Took me awhile to figure out that I had to run in Release Mode to create the .jar.

When I go to http://127.0.0.1:17178/test I see "RemoteServer is running", but next line says "Error fetching connection". Any idea what this means? I am trying to connect to mySql.

Disregard question about the Error Fetching. I see what is going on in my PowerShell window. Thanks again.
 
Upvote 0
Top