B4J Question How to run jRDC2 Server

SHOLA KUKU

Member
Licensed User
Am developing in B4A and wants to run the jRDC2 server on my laptop to conenct to my database.

Thanks.
 

SHOLA KUKU

Member
Licensed User
Thanks.

I want to connect to MSSQL Server eventually. But I watched the video and did the following:

1. I installed WAMP on my PC and created MySql database to mimic the video example
2. I edited the properties file and set the connection, user name and password and port no as defaulf
3. I debugged but couldn't connect. Message: properties file not used. Any idea why this message?
I still dont get where the jRDC2 server component come in?

Thanks.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
3. I debugged but couldn't connect. Message: properties file not used. Any idea why this message?
Post the complete logs of you jRDC2 server. Please note, any changes to the config.properties file requires a recompile of the jRDC2 server (as is, out of box, unmodified jRDC2 code).
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
That's the log for your client (the B4A project). Post the logs from your B4J project (the jRDC2 portion). Note, in the log window, click on one of the log entries, right click and select "Copy all to clipboard". Paste that into the forum here surrounded by the quote tags. Looking at this log, it looks like something is not set up correctly in your config.properties file (wrong jdbc url, username or password). The B4J log may be able to provide more clues.
 
Upvote 0

SHOLA KUKU

Member
Licensed User
Thanks.

Waiting for debugger to connect...
Program started.
2019-11-04 15:48:23.965:INFO::main: Logging initialized @1118ms to org.eclipse.jetty.util.log.StdErrLog
Nov 04, 2019 3:48:24 PM com.mchange.v2.log.MLog
INFO: MLog clients using java 1.4+ standard logging.
Nov 04, 2019 3:48:25 PM com.mchange.v2.c3p0.C3P0Registry
INFO: Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
2019-11-04 15:48:25.562:INFOejs.Server:main: jetty-9.4.z-SNAPSHOT; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 11.0.1+13
2019-11-04 15:48:25.636:INFOejs.session:main: DefaultSessionIdManager workerName=node0
2019-11-04 15:48:25.636:INFOejs.session:main: No SessionScavenger set, using defaults
2019-11-04 15:48:25.640:INFOejs.session:main: node0 Scavenging every 660000ms
2019-11-04 15:48:25.668:INFOejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@21d03963{/,file:///C:/B4A-SAMPLES/jRDC2/jRDC/Objects/www,AVAILABLE}
2019-11-04 15:48:25.672:INFOejs.AbstractNCSARequestLog:main: Opened C:\B4A-SAMPLES\jRDC2\jRDC\Objects\logs\b4j-2019_11_04.request.log
2019-11-04 15:48:25.739:INFOejs.AbstractConnector:main: Started ServerConnector@7f284218{HTTP/1.1,[http/1.1]}{0.0.0.0:17178}
2019-11-04 15:48:25.739:INFOejs.Server:main: Started @2907ms
Emulated network latency: 100ms
jRDC is running (version = 2.22)
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Now you need to do a connection from you B4A project and send you B4J logs after the connection was unsuccessful. The c3p0 pool is "lazy" and will not attempt a database connection until it needs to. Therefore any database issues will not show up until you attempt a connection via your B4A application. (Update: or the test link)
 
Upvote 0

SHOLA KUKU

Member
Licensed User
Thanks.


at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:151)
at java.net.SocketInputStream.read(SocketInputStream.java:120)
at okikio$2.read(Okio.java:138)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:236)
... 28 more
ResponseError. Reason: java.net.SocketTimeoutException: timeout, Response:
isDarkStatusBar======false
Add to mViews: DecorView@df10263[], this = android.view.WindowManagerGlobal@855ca15
CanvasContext() 0x752ce5c000
hardware acceleration is enabled, this = ViewRoot{bb29df9 b4a.example/b4a.example.main,ident = 2}
CanvasContext() 0x752ce5c000 initialize window=0x7534055c00, title=b4a.example/b4a.example.main
Surface::connect(this=0x7534055c00,api=1)
[ANDROID_RECORDABLE] format: 1
EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000
Surface::allocateBuffers(this=0x7534055c00)
CacheTexture 3 upload: x, y, width height = 32, 0, 189, 396
register, handle(0x7518773dc0) (w:1218 h:540 s:1232 f:0x1 u:0x000b00)
ProgramCache.generateProgram: 8864812498944
ProgramCache.generateProgram: 8796098265153
ProgramCache.generateProgram: 8830452760579
register, handle(0x751704a780) (w:1218 h:540 s:1232 f:0x1 u:0x000b00)
register, handle(0x751704b380) (w:1218 h:540 s:1232 f:0x1 u:0x000b00)
 
Upvote 0

SHOLA KUKU

Member
Licensed User
And this...

Logger connected to: Infinix Infinix NOTE 3
*** Debugger waiting for connection (1) ***
DecorView setVisiblity: visibility = 8, Parent = ViewRoot{f6e13d5 b4a.example/b4a.example.main,ident = 1}, this = DecorView@9c887df[]
*** Debugger waiting for connection (1) ***
DecorView setVisiblity: visibility = 8, Parent = ViewRoot{f6e13d5 b4a.example/b4a.example.main,ident = 1}, this = DecorView@9c887df[]
Copying updated assets files (1)
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Surface::disconnect(this=0x7534055c00,api=1)
unregister, handle(0x751877e9c0) (w:1218 h:540 s:1232 f:0x1 u:0x000b00)
unregister, handle(0x7518780b80) (w:1218 h:540 s:1232 f:0x1 u:0x000b00)
unregister, handle(0x7517071840) (w:1218 h:540 s:1232 f:0x1 u:0x000b00)
Surface::disconnect(this=0x7534055c00,api=1)
onWindowFocus: null softInputMode=34 first=false flags=#81810100
register, handle(0x7517071a80) (w:1080 h:1920 s:1088 f:0x1 u:0x000b00)
--------- beginning of system
SVC-Creating service CreateServiceData{token=android.os.BinderProxy@d976e43 className=b4a.example.httputils2service packageName=b4a.example intent=null}
*** Service (httputils2service) Create ***
No Network Security Config specified, using platform default
SVC-Calling onStartCommand: b4a.example.httputils2service@bb29df9, flags=0, startId=1
** Service (httputils2service) Start **
[socket][0] connection /192.168.8.100:17178;LocalPort=-1(30000)
[Posix_connect Debug]Process b4a.example :17178
[socket][/192.168.8.101:55416] connected
ResponseError. Reason: com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@63eef88a -- timeout at awaitAvailable(), Response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 500 com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@63eef88a -- timeout at awaitAvailable()</title>
</head>
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /rdc. Reason:
<pre> com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@63eef88a -- timeout at awaitAvailable()</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>
</body>
</html>

DecorView setVisiblity: visibility = 0, Parent = ViewRoot{f6e13d5 b4a.example/b4a.example.main,ident = 1}, this = DecorView@9c887df[]
CanvasContext() 0x752ce58800 initialize window=0x7534055c00, title=b4a.example/b4a.example.main
Surface::allocateBuffers(this=0x7534055c00)
Surface::connect(this=0x7534055c00,api=1)
[ANDROID_RECORDABLE] format: 1
EGLint new_window_surface(egl_winsys_display*, void*, EGLSurface, EGLConfig, egl_winsys_surface**, egl_color_buffer_format*, EGLBoolean) returns 0x3000
CacheTexture 3 upload: x, y, width height = 32, 0, 200, 368
register, handle(0x7517072500) (w:1218 h:540 s:1232 f:0x1 u:0x000b00)
register, handle(0x7517073ac0) (w:1218 h:540 s:1232 f:0x1 u:0x000b00)
register, handle(0x75186ddb40) (w:1218 h:540 s:1232 f:0x1 u:0x000b00)
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
I need the log from B4J, not B4A
 
Upvote 0

SHOLA KUKU

Member
Licensed User
Thanks OliverA/Erel,

I have watched the video over 5 times and was able to connect to the database and connection successful from my phone as well.

Takeaways:

1. Downloaded WAMP Server and created MySQL database and set all the user/password and port number
2. It's not obvious new users to jRDC2 have to download and run B4J. Following Erel tip, I was able to download and run B4J.
(Thought I have license only to B4A)
3. I was working on config.properties on the B4A client instead of B4J

Am continuing with my exploration and will keep the forum posted.

Grateful!.
 
Upvote 0

josejad

Expert
Licensed User
Longtime User
Hi Shola:

jRDC2 was confusing for me too when I was starting.

Here I explained what I thougth it was confusing for me, the whole thread will help you to understand a little more.

how to connect to mysql database
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…