Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.IllegalArgumentException: Illegal character in scheme at index 0: localhost

I'am developping an android app that receive an data from server (localhost - mssql and nodejs), save data and then display it

after receiving the server response I get this error

I follow the instructions below enter link description here instead of the web server I use localhost. Thank you

 Illegal character in scheme at index 0: 192.168.2.7:3000
    java.net.URISyntaxException: Illegal character in scheme at index 0: 192.168.2.7:3000
            at java.net.URI.validateScheme(URI.java:419)
            at java.net.URI.parseURI(URI.java:363)
            at java.net.URI.<init>(URI.java:204)
            at cz.uhk.fim.jedlima3.searchrooms.asyncTask.DownloadDatabaseAsync.doInBackground(DownloadDatabaseAsync.java:30)
            at cz.uhk.fim.jedlima3.searchrooms.asyncTask.DownloadDatabaseAsync.doInBackground(DownloadDatabaseAsync.java:15)
            at android.os.AsyncTask$2.call(AsyncTask.java:287)
            at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
            at java.util.concurrent.FutureTask.run(FutureTask.java:137)
            at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
            at java.lang.Thread.run(Thread.java:864)
like image 889
user3468921 Avatar asked Jan 23 '15 16:01

user3468921


2 Answers

you should remove space from url and define scheme http or https

like image 185
vahid karimi Avatar answered Nov 18 '22 03:11

vahid karimi


If you are Using localhost then pass url like this- http://localhost:8080/api/notes defining scheme is important (http/https) do not use space also.

like image 28
Shubham Avatar answered Nov 18 '22 03:11

Shubham