Android Question [SOLVED],Remote MongoDB Connector (RMDBC) ERROR

NGUYEN TUAN ANH

Active Member
Licensed User
Dear All,
I have the server set up to run according to this example
https://www.b4x.com/android/forum/threads/b4x-remote-mongodb-connector-rmdbc.72270/
In B4A, I added the following line to the Manifest file
'CreateResourceFromFile(Macro, Core.NetworkClearText)
SetApplicationAttribute(android:usesCleartextTraffic, "true")
The B4J RMDBCServer application was running permanently on the server, but running the B4A application always gave the following error:
Logger connected to: 8437d8ad
--------- beginning of crash
--------- beginning of system
--------- beginning of main
** Service (httputils2service) Destroy **
** Service (starter) Destroy (ignored)**
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
ResponseError. Reason: Server Error, Response: <html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 500 java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (MongoDatabase).</title>
</head>
<body><h2>HTTP ERROR 500 java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (MongoDatabase).</h2>
<table>
<tr><th>URI:</th><td>/rmdbc</td></tr>
<tr><th>STATUS:</th><td>500</td></tr>
<tr><th>MESSAGE:</th><td>java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (MongoDatabase).</td></tr>
<tr><th>SERVLET:</th><td>anywheresoftware.b4j.object.JServlet-41e36e46</td></tr>
</table>
<hr/><a href="https://eclipse.org/jetty">Powered by Jetty:// 11.0.9</a><hr/>
</body>
</html>
Command completed. Success =false
Could please help me
I'm waiting for you here
Thank you very much
 

NGUYEN TUAN ANH

Active Member
Licensed User
Thank Mr. Erel very much
Maybe you right
When the above error occurs on the B4A side, at the same time on the B4J side on the server there is also the following message:
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details.
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (MongoDatabase).
at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
at b4j/anywheresoftware.b4a.BA.raiseEvent(Unknown Source)
at b4j/anywheresoftware.b4j.object.JServlet$Handle.run(Unknown Source)
at b4j/anywheresoftware.b4j.object.JServlet.Handle(Unknown Source)
at b4j/anywheresoftware.b4j.object.JServlet.doPost(Unknown Source)
at b4j/jakarta.servlet.http.HttpServlet.service(Unknown Source)
at b4j/jakarta.servlet.http.HttpServlet.service(Unknown Source)
at b4j/org.eclipse.jetty.servlet.ServletHolder.handle(Unknown Source)
at b4j/org.eclipse.jetty.servlet.ServletHandler.doHandle(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(Unknown Source)
at b4j/org.eclipse.jetty.server.session.SessionHandler.doHandle(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.ContextHandler.doHandle(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.ScopedHandler.nextScope(Unknown Source)
at b4j/org.eclipse.jetty.servlet.ServletHandler.doScope(Unknown Source)
at b4j/org.eclipse.jetty.server.session.SessionHandler.doScope(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.ScopedHandler.nextScope(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.ContextHandler.doScope(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.ScopedHandler.handle(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.HandlerCollection.handle(Unknown Source)
at b4j/org.eclipse.jetty.server.handler.HandlerWrapper.handle(Unknown Source)
at b4j/org.eclipse.jetty.server.Server.handle(Unknown Source)
at b4j/org.eclipse.jetty.server.HttpChannel.lambda$handle$0(Unknown Source)
at b4j/org.eclipse.jetty.server.HttpChannel.dispatch(Unknown Source)
at b4j/org.eclipse.jetty.server.HttpChannel.handle(Unknown Source)
at b4j/org.eclipse.jetty.server.HttpConnection.onFillable(Unknown Source)
at b4j/org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(Unknown Source)
at b4j/org.eclipse.jetty.io.FillInterest.fillable(Unknown Source)
at b4j/org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(Unknown Source)
at b4j/org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(Unknown Source)
at b4j/org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: Object should first be initialized (MongoDatabase).
at b4j/anywheresoftware.b4a.AbsObjectWrapper.getObject(Unknown Source)
at b4j/anywheresoftware.mongo.MongoDatabaseWrapper.GetCollection(Unknown Source)
at b4j/b4j.example.rmdbcserver._find(Unknown Source)
at b4j/b4j.example.rmdbcserver._handle(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
... 32 more
I don't have much experience in this matter
Everyone please help me to solve this problem
Many Thanks .!
 
Upvote 0

NGUYEN TUAN ANH

Active Member
Licensed User
Help me, B4j Log in Server
Caused by: java.lang.RuntimeException: Object should first be initialized (MongoDatabase).
at b4j/anywheresoftware.b4a.AbsObjectWrapper.getObject(Unknown Source)
at b4j/anywheresoftware.mongo.MongoDatabaseWrapper.GetCollection(Unknown Source)
at b4j/b4j.example.rmdbcserver._find(Unknown Source)
at b4j/b4j.example.rmdbcserver._handle(Unknown Source)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
 
Upvote 0
Top