I am going through the tutorial from this post:
From the tutorial I have managed to start the webserver and can confirm the connection to the SQL server database is working. I get the confirmation message as per below when I run the test URL (http://169.254.13.143:17178/test) to test the connection.
RemoteServer is running (09/17/2021 15:45:49)
Connection successful.
Initial error message
I have created the B4A client app as per the tutorial. Initially I got the following error message:
ResponseError. Reason: java.net.UnknownServiceException: CLEARTEXT communication to 169.254.13.143 not permitted by network security policy, Response:
ERROR: java.net.UnknownServiceException: CLEARTEXT communication to 169.254.13.143 not permitted by network security policy
To resolve this I updated the Manifest with the following code:
.
When I re-run the B4A client app I now get the following message in the log:
For reference, please note that in the Manifest editor that the android:targetSdkVersion="29" and I have disabled Windows Firewall (for testing purposes). The 192.168.1.100 refers to the B4A bridge IP. The IP 169.254.13.143 refers to SQL Server and should be working as per the "Connection Successful" message after starting the Webserver.
Any help in diagnosing the error message is much appreciated as I know it may be a SQL Server issue rather than the B4A client or even firewall (although I have temporarily disabled the Windows Firewall).
Although the Webserver appears to be working properly (for your reference) below is the connection string to the SQL Server database:
Partial list of SQL Server settings
The attached image show some of the settings for my SQL Server (which may be the issue):
I have also attached the B4A client program.
Any help in diagnosing the error message is much appreciated as I know it may be a SQL Server issue rather than the B4A client or even firewall (although I have temporarily disabled the Windows Firewall).
Thanks in advance.
From the tutorial I have managed to start the webserver and can confirm the connection to the SQL server database is working. I get the confirmation message as per below when I run the test URL (http://169.254.13.143:17178/test) to test the connection.
RemoteServer is running (09/17/2021 15:45:49)
Connection successful.
Initial error message
I have created the B4A client app as per the tutorial. Initially I got the following error message:
ResponseError. Reason: java.net.UnknownServiceException: CLEARTEXT communication to 169.254.13.143 not permitted by network security policy, Response:
ERROR: java.net.UnknownServiceException: CLEARTEXT communication to 169.254.13.143 not permitted by network security policy
To resolve this I updated the Manifest with the following code:
Error log:
SetApplicationAttribute(android:usesCleartextTraffic, "true")
When I re-run the B4A client app I now get the following message in the log:
Error log from B4A:
Logger connected to: TCL T810H
--------- beginning of main
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**
** Service (httputils2service) Destroy **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
ResponseError. Reason: java.net.SocketTimeoutException: failed to connect to /169.254.13.143 (port 17178) from /192.168.1.100 (port 38098) after 30000ms: isConnected failed: ETIMEDOUT (Connection timed out), Response:
ERROR: java.net.SocketTimeoutException: failed to connect to /169.254.13.143 (port 17178) from /192.168.1.100 (port 38098) after 30000ms: isConnected failed: ETIMEDOUT (Connection timed out)
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**
** Service (httputils2service) Destroy **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
ResponseError. Reason: java.net.SocketTimeoutException: failed to connect to /169.254.13.143 (port 17178) from /192.168.1.100 (port 38106) after 30000ms: isConnected failed: ETIMEDOUT (Connection timed out), Response:
ERROR: java.net.SocketTimeoutException: failed to connect to /169.254.13.143 (port 17178) from /192.168.1.100 (port 38106) after 30000ms: isConnected failed: ETIMEDOUT (Connection timed out)
** Activity (main) Pause, UserClosed = true **
** Service (starter) Destroy (ignored)**
** Service (httputils2service) Destroy **
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
*** Service (httputils2service) Create ***
** Service (httputils2service) Start **
ResponseError. Reason: java.net.SocketTimeoutException: failed to connect to /169.254.13.143 (port 17178) from /192.168.1.100 (port 38110) after 30000ms: isConnected failed: ETIMEDOUT (Connection timed out), Response:
ERROR: java.net.SocketTimeoutException: failed to connect to /169.254.13.143 (port 17178) from /192.168.1.100 (port 38110) after 30000ms: isConnected failed: ETIMEDOUT (Connection timed out)
For reference, please note that in the Manifest editor that the android:targetSdkVersion="29" and I have disabled Windows Firewall (for testing purposes). The 192.168.1.100 refers to the B4A bridge IP. The IP 169.254.13.143 refers to SQL Server and should be working as per the "Connection Successful" message after starting the Webserver.
Any help in diagnosing the error message is much appreciated as I know it may be a SQL Server issue rather than the B4A client or even firewall (although I have temporarily disabled the Windows Firewall).
Although the Webserver appears to be working properly (for your reference) below is the connection string to the SQL Server database:
config.properties in B4J webserver app:
DriverClass=net.sourceforge.jtds.jdbc.Driver
JdbcUrl=jdbc:jtds:sqlserver://169.254.13.143/TestSQLServer
User=Test
Password=Test
#Java server port
ServerPort=17178
Partial list of SQL Server settings
The attached image show some of the settings for my SQL Server (which may be the issue):
I have also attached the B4A client program.
Any help in diagnosing the error message is much appreciated as I know it may be a SQL Server issue rather than the B4A client or even firewall (although I have temporarily disabled the Windows Firewall).
Thanks in advance.