I have published some apps with MariaDB as backend database and now I need to setup WAMP on my local laptop for future development of those apps. I only want the WAMPServer works locally, so I assume that firewall shouldn't be an issue.
I've basically followed this tutorial step by step; the only difference is that the tutorial calls for XAMP while I use WAMPServer 3.2.26 which has been installed recently.
The only thing that doesn't work is that B4A app trying to connect to the DB resulted in timeout when adding a new person. I didn't change the persons.php file. I'm wondering how others solve the problem. Thank a lot in advance.
This is filtered logs:
I've basically followed this tutorial step by step; the only difference is that the tutorial calls for XAMP while I use WAMPServer 3.2.26 which has been installed recently.
The only thing that doesn't work is that B4A app trying to connect to the DB resulted in timeout when adding a new person. I didn't change the persons.php file. I'm wondering how others solve the problem. Thank a lot in advance.
B4X:
Sub InsertNewPersonButton_Click
If NameET.Text.Length<2 Then
Log("Name is missing or to short")
Return
End If
If AgeET.Text = "" Then
Log("Age is missing")
Return
End If
Dim InsertNewPerson As HttpJob
InsertNewPerson.Initialize("InsertNewP", Me)
InsertNewPerson.download2("http://" & ServerIP & "/persons/persons.php", Array As String ("action", "InsertNewPerson", "name", NameET.Text, "age", AgeET.Text))
'InsertNewPerson.GetRequest.Timeout=40000
Wait For (InsertNewPerson) JobDone(j As HttpJob)
If j.Success=False Then
Log(j.ErrorMessage)
ToastMessageShow("No internet connection", True)
j.Release 'no internet
Return
End If
Log(": j.GetString=" & j.GetString)
End sub
Unfiltered logs:** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Error occurred on line: 90 (Main)
java.lang.NullPointerException: Attempt to invoke virtual method 'org.apache.http.params.HttpParams org.apache.http.client.methods.HttpRequestBase.getParams()' on a null object reference
at anywheresoftware.b4a.http.HttpClientWrapper$HttpUriRequestWrapper.setTimeout(HttpClientWrapper.java:442)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:777)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:197)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:8160)
at android.widget.TextView.performClick(TextView.java:16222)
at android.view.View.performClickInternal(View.java:8137)
at android.view.View.access$3700(View.java:888)
at android.view.View$PerformClick.run(View.java:30236)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8550)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
org.apache.http.conn.ConnectTimeoutException: Connect to /192.168.1.11:80 timed out
modified test app attachedorg.apache.http.conn.ConnectTimeoutException: Connect to /192.168.1.11:80 timed out
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:126)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:199)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:174)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:139)
at org.apache.http.impl.client.DefaultRequestDirector.executeOriginal(DefaultRequestDirector.java:1314)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:698)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:560)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:492)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:470)
at anywheresoftware.b4a.http.HttpClientWrapper.executeWithTimeout(HttpClientWrapper.java:316)
at anywheresoftware.b4a.http.HttpClientWrapper.access$0(HttpClientWrapper.java:314)
at anywheresoftware.b4a.http.HttpClientWrapper$ExecuteHelper.run(HttpClientWrapper.java:215)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
assignNativeObject: nativeObject = 0 Surface(name=null)/@0xe071b6b / android.view.SurfaceControl.readFromParcel:1115 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995
Relayout returned: old=(0,1123,719,1339) new=(0,1168,719,1339) req=(719,171)0 dur=33 res=0x100023 s={true 4061357056} ch=true fn=-1
nativeRelease nativeObject s[3812587552]
nativeRelease nativeObject e[3812587552]
nativeRelease nativeObject s[3812587072]
nativeRelease nativeObject e[3812587072]
nativeRelease nativeObject s[4055011840]
nativeRelease nativeObject e[4055011840]
MSG_WINDOW_FOCUS_CHANGED 0 1
MSG_WINDOW_FOCUS_CHANGED 1 1
org.apache.http.conn.ConnectTimeoutException: Connect to /192.168.1.11:80 timed out
nativeRelease nativeObject s[4022022528]
nativeRelease nativeObject e[4022022528]
assignNativeObject: nativeObject = 0 Surface(name=null)/@0xe071b6b / android.view.SurfaceControl.readFromParcel:1115 android.view.IWindowSession$Stub$Proxy.relayout:1820 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995
nativeRelease nativeObject s[3812587808]