Android Question [SOLVED] java.lang.IllegalArgumentException: unexpected url: abc.com:15000/rdc?method=query2

incendio

Well-Known Member
Licensed User
Longtime User
Hi guys,

I am using jRDC2 without any problem with this code
B4X:
Sub CreateRequest As DBRequestManager
    Dim req As DBRequestManager
    req.Initialize( Me, = "http://12.34.56.78:15000/rdc")
    Return req
End Sub

but if the code changed to
B4X:
Sub CreateRequest As DBRequestManager
    Dim req As DBRequestManager
    req.Initialize( Me, "abc.com:15000/rdc")
    Return req
End Sub

Got that error.

Is jRDC2 can only called server with its ip address or there is a way to call it by domain name?
 

DonManfred

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

josejad

Expert
Licensed User
Longtime User
In the original example you get:

B4X:
Sub Process_Globals
   Type DBResult (Tag As Object, Columns As Map, Rows As List)
   Type DBCommand (Name As String, Parameters() As Object)
   Private const rdcLink As String = "http://192.168.0.6:17178/rdc"
End Sub

Sub CreateRequest As DBRequestManager
   Dim req As DBRequestManager
   req.Initialize(Me, rdcLink)
   Return req
End Sub

rdcLink is equal to "http://192.168.0.6:17178/rdc", you don't need to write the =, but probably you need to write the "http://" part to tell the server the protocol you're using
 
Upvote 0

Guru2020

Member
Apart from the http:// part , which I am sure you looked into already, it may be server issue..
Does
http://192.168.0.6:17178/test return "Connection successful" from a web browser?
If not it may be that redirection to port is not successful .. Are you using https ? Then custom port can be problem..

In that case you need to set up a Reverse proxy in your webserver - Apache,nginx etc as the case may be..
 
Last edited:
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
In the original example you get:

B4X:
Sub Process_Globals
   Type DBResult (Tag As Object, Columns As Map, Rows As List)
   Type DBCommand (Name As String, Parameters() As Object)
   Private const rdcLink As String = "http://192.168.0.6:17178/rdc"
End Sub

Sub CreateRequest As DBRequestManager
   Dim req As DBRequestManager
   req.Initialize(Me, rdcLink)
   Return req
End Sub

rdcLink is equal to "http://192.168.0.6:17178/rdc", you don't need to write the =, but probably you need to write the "http://" part to tell the server the protocol you're using
What? Is that so simple?

I am away from the computer, will test it soon, but I guess, you were right thanks.
 
Last edited:
Upvote 0
Top